>>>>>>This is my VFP code - comes up with unrecognised command verb on first line - what am I doing wrong?
>>>>>>
>>>>>>
>>>>>>oXL = CreateObject("Excel.Application")
>>>>>>oXL.Workbooks.Open("c:\aatemp\global.XLSX")
>>>>>>oXL.ActiveWorkbook.Save("c:\aatemp\globalnew.xls", 56)
>>>>>>oXL.Quit()
>>>>>>
>>>>>
>>>>>Do you have Excel installed? What is the version?
>>>>>
>>>>>I just tested this code
>>>>>
>>>>>
>>>>>oXL = CreateObject("Excel.Application")
>>>>>oXL.Workbooks.Open(GETFILE('xlsx'))
>>>>>*oXL.ActiveWorkbook.Save("c:\aatemp\globalnew.xls", 56)
>>>>>oXL.Quit()
>>>>>
>>>>>worked fine for me, no errors.
>>>>
>>>>do I need to have the latest version of Excel installed ie the one that can read xslx files
>>>
>>>Yes, of course. However, it's possible that Microsoft has a free utility to open xlsx files in earlier versions, just like they have for Word. Whether it will work for you, I really don't know.
>>>
>>>Update: you will find the "Compatibility Pack" here:
http://www.microsoft.com/en-us/download/details.aspx?id=3>>
>>I have installed Office 2007
>>
>>and have run this code
>>
>>SET DEFAULT TO c:\aatemp
>>oXL = CreateObject("Excel.Application")
>>oXL.Workbooks.Open(GETFILE('xlsx'))
>>oXL.ActiveWorkbook.Save("c:\aatemp\globalnew.xls", 39)
>>oXL.Quit()
>>
>>on the active workbook line it comes up with Invalid number of parameters
>>
>>What should the correct answer be?
>>
>>Thanks
>
>Instead of Save you need to use SaveAs as Tamar indicated in her response to you.
That works for me - you are a star as always
Colin
Specialist in Advertising, Marketing, especially Direct Marketing
I run courses in Business Management and Marketing