I just had a niggly problem, a user could not run a little applet that has been working for years and years, opening a .csv file formatting it and saving it as a nice .xls file (in 95/97 format).
The user was SURE he was running Office 2003, which the applet was certified to run on.
But he had both Office 2003 AND Office 2010... VFP was automating a copy of 2010 but presenting it in 2003.
Excel 2010 does not have the option to save files in 95/97 format (the underlying value in the SaveAs would be 43).
So, I had to do this:
Regards
Griff
Keep [Smile]ing
There are 10 kinds of people in the world, those who understand binary and those who don't.
The user was SURE he was running Office 2003, which the applet was certified to run on.
But he had both Office 2003 AND Office 2010... VFP was automating a copy of 2010 but presenting it in 2003.
Excel 2010 does not have the option to save files in 95/97 format (the underlying value in the SaveAs would be 43).
So, I had to do this:
Code:
OEXCEL = CREATEOBJECT("Excel.Application")
OEXCEL.Workbooks.Open(m.filename)
IF OEXCEL.VERSION < "12"
OEXCEL.ActiveWorkbook.SaveAs( LEFT(m.filename,AT(".",m.filename))+"xls",43)
ELSE
OEXCEL.ActiveWorkbook.SaveAs( LEFT(m.filename,AT(".",m.filename))+"xls",39)
ENDIF
Regards
Griff
Keep [Smile]ing
There are 10 kinds of people in the world, those who understand binary and those who don't.