Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert .xls to .cvs
Message
From
04/03/2010 00:59:57
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01452345
Message ID:
01452417
Views:
47
Thanks Naomi. that was helpful. I'm getting there. I have pieced together the folowing code.

The only problem remaining is that the save options still pop up for cvs regardless of visible option or not
any suggestions?

k
set safety off
oExcel = Createobject("Excel.Application")
#DEFINE xlCSVMSDOS 24

If Vartype(oExcel) != "O"
* could not instantiate Excel object
* show an error message here
Return .F.
Endif

oWorkbook = oExcel.Application.Workbooks.Open ("C:\mydirectory\myfile.xls")
oExcel.Visible = .F.
oExcel.Application.UserControl=.F.
oExcel.Application.Interactive=.F.  &&& I still get save pop ups --- only remain problem


if val(oExcel.Version) > 11
oExcel.ActiveWorkbook.SaveAS("c:\mydirectory\mynewfile.csv", xlCSVMSDOS )
else
oExcel.ActiveWorkbook.SaveAS("c:\mydirectory\mynewfile.csv", xlCSVMSDOS ) 
endif


oExcel.Visible = .T.  &&& save options still pops up in vfp even if i keep detting to .F. for all three
oExcel.Application.UserControl=.T.
oExcel.Application.Interactive=.T.

oExcel.quit()
oExcel = .Null.

copy file c:\vaniermu\admission.csv to c:\vaniermu\admission.txt  &&& this works resolves the above problem
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform