Consultor Eletrônico



Kbase P163742: 4GL/ABL: Error 5890 executing Microsoft EXCEL 2007 SaveAs method with FileFormat parameter of 43
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   13/04/2010
Status: Unverified

SYMPTOM(s):

4GL/ABL: Error 5890 executing Microsoft EXCEL 2007 SaveAs method with FileFormat parameter of 43

Error occurred while accessing component property/method: SaveAs. SaveAs method of Workbook class failed Error code: 0x80020009 SaveExclFile.p (5890)

Error 5890 executing SaveAs method with FileFormat parameter xlExcel9795

Error is generated executing the Microsoft EXCEL 2007 Workbook SaveAs method as in the following snippet:
ASSIGN
cMyNewFile = "myfile.xls".
/* Other code here */
chWorkbook:SaveAs(cMyNewFile,43,,,,,).

Same 4GL/ABL code works fine when run with earlier versions of Microsoft EXCEL

FACT(s) (Environment):

Windows
Progress 9.x
OpenEdge 10.x

CAUSE:

Microsoft EXCEL 2007 does not support the xlExcel9795 = 43 file format. The xlExcel9795 ( decimal value 43) instructed the earlier versions of EXCEL to save two formats in a single file. This format was introduced by Microsoft for organizations that are upgrading gradually to Microsoft Excel 2000. The support for this format was dropped by Microsoft in Microsoft EXCEL 2007.

FIX:

To save the file in the default xlWorkbookDefault = 51 format ( i.e. the Excel 2007 default .xlsx format), modify the above code to:
ASSIGN
cMyNewFile = "myfile.xlsx".
/* Other code here */
chWorkbook:SaveAs(cMyNewFile,51,,,,,).
To save the file in the xlExcel8 = 56 format (i.e. the Excel 97-2003 format in Excel 2007-2010 default .xls format), modify the above statement to:

ASSIGN
cMyNewFile = "myfile.xls".
/* Other code here */
chWorkbook:SaveAs(cMyNewFile,51,,,,,).
To save the file in another format, consult the Microsoft Excel documentation on the xlFileFormat class that enumerates the formats available to you.