Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP8 importing from Excel
Message
 
To
28/01/2009 13:22:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01377715
Message ID:
01377799
Views:
22
That did the trick, thank you. Tamar did point out why export wasn't working as expected.


>>>I want to import from an XLS file via: "impo FROM e:some-xls-file.xls type xls"
>>>but it fails and a google seach reveals known issues. Has anyone got a quick resolution to this?
>>
>>For Excel 2003 format, use TYPE XL8. For Excel 2007 format, you can't use IMPORT. Unfortunately, Excel 2007 is broken, so that even when you save in the earlier format, you can't IMPORT/APPEND those files.
>>
>>Tamar
>
>This probably depends. I have a supplier who used to send me his procelist in an old Excel format, but last autumn they clearly updated to Excel 2007, and my import routine was broken. Instead of rewriting my importing routine, I added this code which reads the Excel file and writes it back in the older Excel format.
>lcFile='myfile.xls'
>Erase (Forceext(lcFile,'xxx'))
>ox=Createobject('excel.application')
>owb=ox.Workbooks.Open(lcFile)
>lcFile=Forceext(lcFile,'xxx')
>ox.DisplayAlerts= .F.
>owb.SaveAs(lcFile,39)
>*!*   owb.SaveAs('p:\diverse\jdc\price1.xls',39)
>owb.close()
>owb=.null.
>ox=.null.
>Release owb
>Release ox
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform