Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Save an Excel file as .DBF
Message
From
17/03/2009 19:31:04
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Save an Excel file as .DBF
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01388897
Message ID:
01388897
Views:
101
Hi, a customer wants to save some cursors to an excel file and then save the workbooks as a dbf file (from excel)
No problem in inserting the data in excel, only dont know why it doesnt save the file as a dbf in the automation below..
Any idea whats the problem?

TIA
Peter

Im using this code
#DEFINE xlDBF4 11
&& some code... for the cursors

oExcel = CREATEOBJECT("Excel.Application")
WITH oExcel
	.DisplayAlerts = .F.
	.Workbooks.ADD
	.VISIBLE = .T.
	WITH .ActiveWorkBook
		FOR ix = 1 TO 5		
			lcCursorName = 'crsToExcel' + LTRIM(STR(m.ix))
			IF .sheets.COUNT < m.ix
				.sheets.ADD(,.sheets(.sheets.COUNT)) 
			ENDIF
			.WorkSheets(m.ix).NAME = sheetNames[m.ix]
			VFP2Excel(m.lcCursorName, .WorkSheets(m.ix),"A1" )
		ENDFOR
		.WorkSheets(1).ACTIVATE
	ENDWITH
ENDWITH

oExcel.Workbooks.SAVEAS("C:\Some_Name.dbf",xlDBF4)  && problem is here 
oExcel.Workbooks.CLOSE(0)  
oExcel.QUIT
The error message is:
OLE error code 0x80020006: Unknown name
Next
Reply
Map
View

Click here to load this message in the networking platform