Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Save Excel worksheet as text from VFP
Message
From
09/05/2001 08:56:50
 
 
To
09/05/2001 05:21:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00505014
Message ID:
00505223
Views:
19
>>I need to create a comma delimited text file from an Excel 97 spreadsheet using OLE Automation in VFP. I can't seem to find an example of how to do this.
>>
>>I know enough to instantiate Excel and open the workbook and navigate to the worksheet using the Excel object but how do I find the command to Save As comma delimited? Something like oWs.SaveAs("Myfile.txt",42) where 42 is the arbitrary number denoting the file type.
>>
>>Documentation is sparse. Thanks for your help!
>>
>>-JT
>
>
#Define xlCSV  6
>#Define xlCSVMac  22
>#Define xlCSVMSDOS  24
>oExcel = createobject("Excel.application")
>With oExcel
>  .Workbooks.open(Getfile('XLS'))
>  With .ActiveWorkbook
>    .Activesheet.SaveAs(sys(5)+curdir()+"myExcelCSV.txt",xlCSV)
>    .Saved = .t.
>  Endwith
>  .Quit
>Endwith
Cetin

Perfect. Thanks Cetin I'll give it a try!
Jeff Trockman, MCP
Previous
Reply
Map
View

Click here to load this message in the networking platform