I've a problem with delete method in excel. I would like to delete a sheet with name "DATA".
it found this sheet in xls file but after this method oExcel:WorkSheets( n ):Delete(). The DATA sheet is still exist in excel file. I don't know what does it wrong?
Regards,
Dutch
it found this sheet in xls file but after this method oExcel:WorkSheets( n ):Delete(). The DATA sheet is still exist in excel file. I don't know what does it wrong?
Regards,
Dutch
#include 'fivewin.ch'
FUNCTION MAIN()
LOCAL oExcel, oSheet
LOCAL nRow, nSheets, n
LOCAL nCounter, nStart, nSeconds, nSecOle, nSecClip, nSecArray
LOCAL cMemo, cData, aData
set century on
set epoch to 1950
oExcel = CREATEOBJECT( "Excel.Application" )
oExcel:WorkBooks:Open("d:\fwh\samples\testxls.xls")
nSheets := oExcel:Sheets:Count()
for n := 1 to nSheets
if upper( oExcel:WorkSheets( n ):Name )=="DATA"
oExcel:WorkSheets( n ):Delete()
msginfo('delete')
end
next
oExcel:Visible := .T.
oExcel:Quit()
return nilRegards,
Dutch
FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)