>>>>>>Is there any way to COPY to an XLSX file rather than XLS?
>>>>>>
>>>>>>Would this also apply to VFP 5.0?
>>>>>
>>>>>If a MS Exccel is on the comp, automation can do the job.
>>>>
>>>>Do you mean by COPYing to a DELIM and then opening the DELIM file from Excel and saving it as an XLSX?
>>>
>>>No, I mean to use VFP to control MS Excel.
>>>
>>>just enter in the command window something like
>>>
>>>loExcel = createobject('Excel.Application')
>>>
>>>for start and then start to browse the pems of loExcel.
>>>
>>>You can do anything that is possible from VBA for Application (it's called like that?) That wahta does macros in Excel.
>>
>>Using the Excel object is what I meant.
>>
>>I would think that COPYing to a DELIM file and then using automation to read in the DELIM file with the Excel object and then saving it to a XLSX would be faster than constructing each row with the Excel object, especially if we're talking a large file.
>>
>>Thanks for the suggestion.
>
>Why row by row? There are only two ways: cell by cell or range. A range could be all at once.
>If you use automation to create / save the file + writing the data as one selection of range and one value assignment will not be slower then creating a external file and importing it.
>It also gives you the posibility to export memos, and do any alteration you like.
>
>Lutz
Turns out it is as simple as this:
LOCAL loExcel AS Excel.APPLICATION
USE foo
copy to xoo XL5
loExcel = CREATEOBJECT("Excel.application")
loExcel.VISIBLE = .F.
loExcel.displayalerts = .F.
loExcel.AskToUpdateLinks = .F.
lcFileName = 'xoo'
loWorkBook = loExcel.Workbooks.OPEN(lcFileName + '.xls')
loWorkBook.SAVEAS(lcFileName + '.xlsx', 51)
loWorkBook.CLOSE()
loExcel.QUIT()
RELEASE loExcel
loExcel = NULL
DELETE FILE xoo.xls