I was so glad to have back "my append from sdf". It works, but I have to save "sheet.xls" to "sheet.prn" and so on. Then I remembered that in my self-introduction Marek and Serge told me I could directly read from excel and write to dbf.
Serge sent this function:
LOCAL oExcel, oWorksheet, i
IF ! MsgYesNo('Start to process?','Confirm')
oExcel := CreateObject( "Excel.Application")
oExcel:Workbooks:Open( GetCurrentFolder()+"\newshop.xls" ) // here right name
oExcel:Visible := .t.
for i = 4 to 7 // here
repl typeo with cTypeO, typen with cTypeN, cust_code with cCustCode, cust_name with cCustName
There is one problem I could not solve:
If "counter" i=NumberOfLastRow+1 then, though the records are appended to dbf-file, the program crashes at runtime.
Of course I could open excel-file outside the program press ctrl and end and could enter the NumberOfLastRow via textbox-control Seems not very professional.
In a german xbase-forum I found these 3 lines of code:
and added them to Serge's function.
Compiling the first of these 3 lines I get a syntax-error.
I have no knowledge of VBA.
Who knows what went wrong?
EDIT: Maybe the crash can be avoided by errorhandling?