Page 1 of 1

Find out the range of a excel-sheet

Posted: Thu Dec 05, 2019 6:19 pm
by Marc Vanzegbroeck
Hi,

I have to import an excel file into a database an now I'm using the oSheet:Cells( nRow, nCol ):Value methode to read the first column to know
how many records the are, and read the fist row , how many colums to import.
Then I can use GetExcelRange()
Is there a faster way to know which row is the first empty cell, and which column is the first empty one?

Re: Find out the range of a excel-sheet

Posted: Thu Dec 05, 2019 6:35 pm
by nageswaragunupudi
oRange := GetExcelRange( cExcelFile )
Automatically returns the used range.

Re: Find out the range of a excel-sheet

Posted: Thu Dec 05, 2019 7:59 pm
by Marc Vanzegbroeck
Thank you,

With len( ArrTranspose( oRange:Value )) and now how many records there are, but how can I know the numbers of columns?

Re: Find out the range of a excel-sheet

Posted: Thu Dec 05, 2019 8:10 pm
by nageswaragunupudi
? oRange:Rows:Count
? oRange:Columns:Count

Re: Find out the range of a excel-sheet

Posted: Thu Dec 05, 2019 8:14 pm
by Marc Vanzegbroeck
Thank you,

I just found that also

Code: Select all

len( ArrTranspose( oRange:Value )[1])
works :D

But your suggestion is nicer :)