>>>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.
----------------------------------
António Tavares Lopes