>>>>An app has a function to save VFP data as a .XLSX file. The code below is 100% reliable on machines running Excel 2007 on Windows 7. On some machines with Windows 10 and Excel 2016, it fails when a call is made for Excel to open the FOX2X file.
>>>>
>>>>Does anyone have any ideas why Excel 2016 and/or Win10 might not like this code?
>>>>[...]
>>>
>>>Why not just COPY ALL TO ( m.lcDBF2X ) TYPE XLS?
>>>(of course you should change extension)
>>
>>Unfortunately that makes no difference. It returns "OLE error code 0x80004005: Unspecified error." on trying to open the .XLS file.
>>
>>We need to open the file in Excel for some post-processing (updating column header names etc).
>
>Can't you consider using any of the VFP to XLSX libraries available (Greg's or Vilhelm-Ion's, for instance) and pass the data already as a current Excel document? If the changes you are requiring are just small ones, it might eventually remove the need for Excel.application going into the process.
This has proven difficult to debug on machines that display the issue. My gut feel is it's some sort of Excel/Office issue; if I read Tore's last response correctly, he ran my code against Excel 2016 on Windows 10, without error.
However, if we can't find and fix the issue on these newer machines/installations we may have to work around it, perhaps avoiding Excel entirely as you suggest.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up