Client Not Updated with Multiple Instances of Excel (107745)



The information in this article applies to:

  • Microsoft Excel 97 for Windows
  • Microsoft Query

This article was previously published under Q107745

SUMMARY

When multiple instances of Microsoft Excel are simultaneously serving as dynamic data exchange (DDE) clients to a single DDE server, only one instance of Microsoft Excel will be updated.

MORE INFORMATION

This is a problem with the current implementation of the DDE management library (DDEML). The problem will only occur when all of the following conditions are met:
  • There are two or more instances of the same application serving as DDE clients.
  • The applications all have objects with the same name (such as "Sheet1")
  • The applications are all trying to use FETCH.ADVISE

Steps to Reproduce Problem

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
  1. Start Microsoft Query.
  2. Open two instances of Microsoft Excel and run the following Visual Basic macro from each instance:
       Sub dde()
    
          chanNum = DDEInitiate("msquery", "system")
          ' Use the path for your query file for the following:
          ' Note: query files in Excel 97 contains a dqy extension.
          DDEExecute chanNum, "[open('c:\excel\query1.qry')]"
          nRows = DDERequest(chanNum, "NumRows")
          nCols = DDERequest(chanNum, "NumCols")
          DDEExecute chanNum, "[fetch.advise('Excel','sheet1','r1c1:r" & _
          nRows(LBound(nRows)) & "c" & nCols(LBound(nCols)) & "','all')]"
    
       End Sub
    						
    NOTE: You will need to create a query file to run this macro if you don't already have one. Use the path for this file in line 2 of the macro.)
  3. Check Sheet1 on both instances of Excel; they should display a copy of the query.
  4. Switch to Query Tool and from the Records menu, choose Allow Editing.
  5. Change some of the records in the query.
Check Sheet1 on both instances of Microsoft Excel; the records should have been updated on one but not the other.

Modification Type:MajorLast Reviewed:6/23/2005
Keywords:kbProgramming KB107745