Hi,
I'm using activeX to read some XLS files.
When the import is done, I have a 'oExcel:Destroy()'. If I check with Taskmanager, it looks as Excel remains active after this destroy.
Some hints to prevent this? Or correct way to stop Excel?
Excell remains active
Re: Excell remains active
This is my code from DC_WorkArea2Excel():
Code: Select all
oSheet:destroy()
oBook:close()
oBook:destroy()
// Quit Excel
oExcel:Quit()
oExcel:Destroy()
The eXpress train is coming - and it has more cars.
Re: Excell remains active
Thanks Roger,
Problem is solved.
Finding the last row of a sheet isn't very simple to find. In case anyone ever needs this, the following seems to work correctly:
oUsedRange := oSheet:usedrange
nMaxLines := oUsedrange:rows:count()
Problem is solved.
Finding the last row of a sheet isn't very simple to find. In case anyone ever needs this, the following seems to work correctly:
oUsedRange := oSheet:usedrange
nMaxLines := oUsedrange:rows:count()
Re: Excell remains active
Chris,
or this way
oBook:Worksheets(1):activate() // Activate sheet
oSheet := oBook:Worksheets(1) // Shortcut
oExcel:Application:ActiveCell:SpecialCells(xlLastCell):Select
nRow := oExcel:Application:ActiveCell:Row
or this way
oBook:Worksheets(1):activate() // Activate sheet
oSheet := oBook:Worksheets(1) // Shortcut
oExcel:Application:ActiveCell:SpecialCells(xlLastCell):Select
nRow := oExcel:Application:ActiveCell:Row
Klaus
Re: Excell remains active
I receive the entire worksheet into an array with the following:
Code: Select all
aValues := oBook:workSheets(1):usedRange:value
The eXpress train is coming - and it has more cars.