Forget about DDE execute. It's very very old and very very dead technology. To open a spreadsheet, use the Send Event script step and pass it the OS path to where the spreadsheet is.
I wouldnt say DDE execute is dead, it still has it's uses. I've used it for years to create simple merges with Word documents and it's always been reliable.
The service name for excel should be excel:
Send DDE Execute [Service Name: "excel"; Topic: "system"; Commands: ""]
I tried your suggested syntax but it didn’t work. I keep getting an error code 3.
Maybe some additional information should have been provided. The Excel file (Test Drive.xls) I’m trying to open is located on an external hard drive ( drive G:).
I’m running Windows 7.
Thanks for your help…Don
I wouldnt say DDE execute is dead,
Oh, believe me, it's dead. Microsoft has pulled it from the last couple of Visual Studio versions so developers are not supposed to use it any new projects anymore. It's still available in products like FM for legacy purposes but don't be surprised in newer versions of FM or MS Office stop supporting it in the near future. Look at what happend to OLE support in FM12.
You're better of preparing for it now and swithing to other techniques while you have the time to do it.
Ok, if I use the Send Event to open the Excel spreadsheet, how do I close the Excel spreadsheet using a script step? I can’t have the user close the spreadsheet opened by the Send Event script step.
A couple of different ways. The brute-force approach is to use the command line "taskkill" and feeding it the name of your file.
I prefer to use VBscript to talk to the Excel ActiveX objects and ask it to close the file. Using this you get to choose to save or not save the file before closing it.
Thanks for your suggestions.
I’m not familiar with how you would script a command line taskkill or a VBscript to talk to the Excel ActiveX objects. Can you provide an example of how I would script these.
At your suggestion I’m now using the Send Event script to open my Excel spreadsheet.
I did some research on your “Taskkill” suggestion. I now use the Send Event script to close (taskkill) the Excel spreadsheet previously opened. I was able to get the Excel file close to work using the following script step:
Send Event ["CMD /C TASKKILL/F /IM " & "Excel.exe" & " /T"]
Thanks for your help, Don
hello, I see that this is an older post but wondering if anyone can help - I'd like to do something similar and open a specific file or even a specific folder but not on the host machine but over the network - i would like windows explorer or open then see the folder that i want - i can i do this with send event please? thanks
You can use "Open URL" with "file:\\\server\share\folder" for windows shared folder (or file in it). I'm not sure about "not on the host machine but over the network".