Microsoft KB Archive/96351

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft Visual FoxPro for Windows, versions 3.0, 6.0
 * Microsoft FoxPro for Windows, versions 2.5, 2.5a

-

SUMMARY
When you are using dynamic data exchange (DDE), variables used in the DDEExecute command must be concatenated because all the characters between the single quotation marks are sent to the application for interpretation.

MORE INFORMATION
The following command opens the spreadsheet TEST.XLS if Microsoft Excel is already open:

  =DDEExecute(chan,'[Open(&quot;test.xls&quot;)]') However, the following DDEExecute command will not work:   filename= &quot;test.xls&quot; =DDEExecute(chan,'[Open(filename)]') This command can be made to work by issuing the following DDEExecute command:   =DDEExecute(chan,'[Open('+'&quot;'+filename+'&quot;)]') The above command encloses the double quotation marks expected by Microsoft Excel in single quotation marks.

Concatenation of the quotation marks must be done in the command itself since DDEExecute is sending the entire string between the single quotation marks to Microsoft Excel.

Another alternative is to concatenate the entire command before the DDEExecute command, and use macro substitution as follows:   testname= &quot;test.xls&quot; ddecomm= &quot;'[Open(&quot;+CHR(34)+&quot;d:\excel4\&quot;+testname+CHR(34)+&quot;)]'&quot; =DDEExecute(chan,&ddecomm) NOTE: CHR(34) provides the double quotation marks required by the Microsoft Excel Open command. Additional query words: VFoxWin FoxWin 2.50 quotes

Keywords         : FxinteropDde Version          : 2.50 2.50a 3.00 Platform         : WINDOWS Issue type       :
 * }