Find out the range of a excel-sheet

Post Reply
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Find out the range of a excel-sheet

Post 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?
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Find out the range of a excel-sheet

Post by nageswaragunupudi »

oRange := GetExcelRange( cExcelFile )
Automatically returns the used range.
Regards

G. N. Rao.
Hyderabad, India
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: Find out the range of a excel-sheet

Post 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?
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Find out the range of a excel-sheet

Post by nageswaragunupudi »

? oRange:Rows:Count
? oRange:Columns:Count
Regards

G. N. Rao.
Hyderabad, India
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: Find out the range of a excel-sheet

Post 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 :)
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Post Reply