Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel SaveAs Command Difficulties
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01254140
Message ID:
01254153
Vues:
15
>Hello everyone,
>
>I have an annoying problem with a certain XLS file that I'm trying to automatically save to "Excel 5.0/95" format via OLE automation.
>
>When I use the following code to save the spreadsheet (which has a VBA module and is in Excel 97/2003):
>
>PROCEDURE ExcelSaveAs
>PARAMETERS tcObjectRef, tcSpreadsheetFile
>LOCAL loExcel, lcSpreadsheetFile, lcSpreadsheetFileNew
> loExcel = tcObjectRef
> lcSpreadsheetFile = tcSpreadsheetFile
>
> loExcel.AskToUpdateLinks = .F.
> loExcel.DisplayAlerts = .F.
> loExcel.Workbooks.OPEN(lcSpreadsheetfile)
> loExcel.ActiveWorkbook.SaveAs(lcSpreadsheetFile, 39, "", "", .F., .F.) && 39 = Excel 5.0/95 Format
>ENDPROC
>
>I get a "OLE error code 0x800a9c64: Unknown COM status code" when executing the "SaveAs" line of code.
>
>If I create a new spreadsheet with a few character, numeric and date values in it, save it in Excel 97/2003 format and then run the same code on it, it works fine.
>
>What functionality (besides the VBA module) in a Excel 97/2003 spreadsheet would cause this kind of an error to occur when I'm running under VFP9 and Office 2007?
>
>Thanks in advance,
>
>Ben Holton


How about:
loExcel.ActiveWorkbook.SaveAs(lcSpreadsheetFile, 39, , , .F., .F.) && 39 = Excel 5.0/95 Format
I didn't have Excel installed on my computer that is why I can't test this right now.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform