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
>>
>>
>>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)
>>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)