AnsweredAssumed Answered

DDE save.as to Excel or another option?

Question asked by kiwikaty on Aug 19, 2013
Latest reply on Aug 22, 2013 by kiwikaty

Hi, I am pretty desperate for some help in relation to an issue that is pushing me well over deadline. I am on windows 7 and am trying to get DDE to work and getting error 3. I am trying to use DDE to do a save.as for excel. I know DDE is old school but please read on...

 

I have no idea if I am getting error 3 because I don't have the syntax right... so was wondering if anyone had an example of what you need to use where you want to use DDE from fm to excel to do a save.as? I have the file path as a variable.

 

I am trying to do this crazy workaround as I need the excel file I have created via html to be saved as a real xls before fm emails it to the user. I need to change excel from defaulting it save type .html and instead make it save type .xls - so it is more than changing the name (which is already .xls) - I am really trying to change what filetype excel thinks the file is (which I think you can do if you get the DDE command right).

 

I was meant to have this solution delivered last week and have tried dozens of different approaches to no success. I first tried adding code to the html to recognize that the output should be an xls but still get this message "The file you are trying to open,XXXX,is in different format than specified by the file extension" when the file is opened in xls - even if I bite the bullet and tell users to click yes to this message as they open it, I am still having the issue that when they make changes to the spreadsheet and save it... excel is saving it as .html and not .xls. I have to try and force the file to become a real xls before attaching to the email.

 

I am generating the html from within fm (so I can format the excel spreadsheet and keep the formulas intact) then exporting the html chunk in a single field (and single record) as a tab separated file but getting filemaker to call it $filePath.xls - this works in the fact the spreadsheet looks as I want it with the embedded data and formulas in place and excel happily opens it thanks to the .xls extension - I am just stuck on tricking excel into re-saving it as a proper.xls.

 

I don't know if DDE is the answer but will try anything as long as I can make it work without having to do anything to the 100+ client machines.

 

Any advice appreciated.

Kind regards

Katy

Outcomes