Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Export a dbf to a xls or xl5
Message
 
 
To
08/03/2005 17:43:12
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00993820
Message ID:
00993841
Views:
24
You can copy out to CSV and than use Excel automation to conver to XLS. Sample code
SELECT mytable
lcCsvFile = "H:\temp\something.csv"
lcExcelName = FORCEEXT(lcCsvFile, "XLS")
COPY TO (lcCsvFile) TYPE CSV
oExcel = CreateObject("Excel.Application")
*oExcel.Visible = .T.
oWorkbook = oExcel.Workbooks.Open(lcCsvFile)
IF FILE(lcExcelName)
	ERASE (lcExcelName)
ENDIF	
xlExcel5 =	39
oWorkbook.SaveAs(lcExcelName,xlExcel5)
oExcel.Quit()

* Launch Excel with file created
RUN "&lcExcelName"
>thnx sylvain for your reply but aie aie i'm now in big troubles now....
>cvs is no alternative because the user wants them in a excel file... and i can't update to vfp9 ....
>
>Maybe there is another solution to my problem. Can't be i'm the only one with this issue or am i so unique lol
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform