Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Save an Excel file as .DBF
Message
De
17/03/2009 20:31:42
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01388897
Message ID:
01388924
Vues:
49
dbf4 would be dBASE IV, I believe? Would Excel 2007 still support dBASE III format? Or some similar option?

>First, it should be
>
>oExcel.ActiveWorkBook.SAVEAS("C:\Some_Name.dbf",xlDBF4) 
>
>
>Second, Excel 2007 doesn't support such save format anymore.
>
>
>
>
>>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
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform