Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Importing Excel 2007 files
Message
De
02/12/2007 23:49:11
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01272524
Message ID:
01272733
Vues:
28
>Pertti
>
>Do you do the SaveAs into 5.0/95 format programatically? If yes, can you show how?
>
>Cyril

Cyril:

This oughta do the trick:
loxl = CREATEOBJECT('excel.application')
loxl.workbooks.Open("C:\MyExcel2007File.xls")
loxl.ActiveWorkbook.SaveAs("c:\MyExcel95File.xls",39)
Save As code 39 saves your file in Excel 5/95, and then you can import it to VFP without any problems. The dumb thing is that it is very, very difficult to find this code. I looked high and low, and finally saved 2007 spreadsheet manually as 95 spreadsheet, then opened it in VFP and queried the filetype with:
?loxl.ActiveWorkbook.fileformat
Pertti

>
>
>>Scott,
>>
>>I've been using SaveAs into 5.0/95 format. ODBC, as Cetin mentioned, is another route that avoids saveas, but is not nearly as convenient and flexible as IMPORT XLS.
>>
>>
>>Pertti
>>
>>>I'm having trouble using the IMPORT command in VFP9 to load Excel 2007 files. I'm not surprised that the .XLSX extension files fail, but even files saved in newer formats than 5.0/95 seem to fail if they were created by Excel 2007.
>>>
>>>What alternatives are available for importing Excel files created by or saved by Excel 2007 into VFP9?
>>>
>>>- Manually using SaveAs
>>>- Automation: SaveAs
>>>- Automation: Cell by Cell access
>>>
>>>Others?
>>>
>>>Also, I noticed that Advisor has a workaround (http://my.advisor.com/doc/19289) but my subscription expired last year. Anyone know the solution they suggested?
>>>
>>>Thanks,
>>>Scott
Pertti Karjalainen
Product Manager
Northern Lights Software
Fairfax, CA USA
www.northernlightssoftware.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform