ID: Q96351
2.50 2.50a 3.00 WINDOWS kbinterop kbprg
The information in this article applies to:
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.
The following command opens the spreadsheet TEST.XLS if Microsoft Excel is already open:
=DDEExecute(chan,'[Open("test.xls")]')
However, the following DDEExecute() command will not work:
filename= "test.xls"
=DDEExecute(chan,'[Open(filename)]')
This command can be made to work by issuing the following DDEExecute()
command:
=DDEExecute(chan,'[Open('+'"'+filename+'")]')
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= "test.xls"
ddecomm= "'[Open("+CHR(34)+"d:\excel4\"+testname+CHR(34)+")]'"
=DDEExecute(chan,&ddecomm)
NOTE: CHR(34) provides the double quotation marks required by the
Microsoft Excel Open command.
Additional reference words: VFoxWin 3.00 FoxWin 2.50 2.50a quotes KBCategory: kbinterop kbprg kbvfp300 kbvfp600 KBSubcategory: FxinteropDde
Keywords : FxinteropDde
Version : 2.50 2.50a 3.00
Platform : WINDOWS
Last Reviewed: October 23, 1998