Dan Freeman
2003-09-16 20:57:39 UTC
#DEFINE xlCSV 6
objbook.saveas(filename,xlCSV)
You can find this syntax by recording a macro in Excel to do a SaveAs, and
then look at the generated code.
Dan
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\danf\My Documents\Book1.csv",
FileFormat:=xlCSV
objbook.saveas(filename,xlCSV)
You can find this syntax by recording a macro in Excel to do a SaveAs, and
then look at the generated code.
Dan
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\danf\My Documents\Book1.csv",
FileFormat:=xlCSV
I'm creating a file in Excel and I want to save the file as a type CSV
onceI have the file created. Can someone please tell me the correct syntax to
use to save this file as CSV? I'm using VFP 7.0.
objexcel = CreateObject("Excel.application")
objexcel.visible = .F.
objbook = objexcel.workbooks.add()
* Make sure columns are in text format
objexcel.columns("A:Z").Select
*** Put data in rows/columns
objexcel.displayalerts = .F. && turn off alerts and questions from Excel
objexcel.range("A1").select
objbook.saveas(filename)
objexcel.quit
Release objbook,objexcel
use to save this file as CSV? I'm using VFP 7.0.
objexcel = CreateObject("Excel.application")
objexcel.visible = .F.
objbook = objexcel.workbooks.add()
* Make sure columns are in text format
objexcel.columns("A:Z").Select
*** Put data in rows/columns
objexcel.displayalerts = .F. && turn off alerts and questions from Excel
objexcel.range("A1").select
objbook.saveas(filename)
objexcel.quit
Release objbook,objexcel