10 Replies Latest reply on Jan 4, 2017 7:45 PM by user19752

    Send DDE Execute Questions

    don6397

      I'm trying to open an Excel spreadsheet using a DDE Execute script step. I've reviewed FM Help which shows the syntac to be "Send DDE Execute [<topic text or file name>; <service name>]". However, when completing the script, a Service Name, a Topic which is a File Name or Text and a Command is required which is different than what Help defines.

       

      My question is where do I find the Service Name? Help states that you should refer to the documentation for the application you specify for the valid service name. I've looked in Excel for the Service Name but could not idendify a Service Name. The Help example uses "iexplore" for the Service Name. Is there a list somewhere?

       

      Topic in the Help example shows "WWW_OpenURL" for the Topic and "www.filemaker.com" for Commands. The DDE script step wants a file name for the Topic and a Command. Are there more detail instructions for for completing the script steps?

       

      Can anyone provide the DDE Execute syntac in relation to the DDE Execute script options to open an Excel spreadsheet?

        • 1. Re: Send DDE Execute Questions
          wimdecorte

          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.

          • 2. Re: Send DDE Execute Questions
            MattLeach

            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: ""]

            • 3. Re: Send DDE Execute Questions
              don6397

              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

              • 4. Re: Send DDE Execute Questions
                wimdecorte

                MattLeach wrote:

                 

                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.

                • 5. Re: Send DDE Execute Questions
                  don6397

                  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.

                  • 6. Re: Send DDE Execute Questions
                    wimdecorte

                    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.

                    • 7. Re: Send DDE Execute Questions
                      don6397

                      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.

                      • 8. Re: Send DDE Execute Questions
                        don6397

                        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

                        • 9. Re: Send DDE Execute Questions
                          sethpomeroy

                          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

                          • 10. Re: Send DDE Execute Questions
                            user19752

                            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".