Page 1 of 1

GetExcelRange wrong return

Posted: Wed Aug 19, 2020 9:25 pm
by dutch
I have define columns types as text in 156 rows and 6 columns.
I use GetExcelRange( cExcelFile) but return many 156 rows and 6 columns with empty rows and columns as picture.

? oRange:Rows:Count // return 156
? oRange:Columns:Count // return 6

Image

Thanks in advance for any help and advise.

Re: GetExcelRange wrong return

Posted: Thu Aug 20, 2020 4:39 am
by nageswaragunupudi
I see 6 rows only in both xbrowse and excel sheet.
Can you explain your problem more clearly?

Re: GetExcelRange wrong return

Posted: Fri Aug 21, 2020 1:17 am
by dutch
Dear Master Rao,
nageswaragunupudi wrote:I see 6 rows only in both xbrowse and excel sheet.
Can you explain your problem more clearly?
It reads 156 rows ( 6 datas and 150 empty ) and 1 empty column.

FYI, I select 156 rows/ 6 columns and define as Text in Format cells. The function will select all even empty rows and columns.

Thanks in advance.

Re: GetExcelRange wrong return

Posted: Fri Aug 21, 2020 6:10 am
by nageswaragunupudi
By default, it will select
oSheet:UsedRange.

And UsedRange includes any cells the user has used even for formatting even if does not have any data.

If you want to read only specific range, then you can specify the range explicitly in the function in the 3rd parameter

Re: GetExcelRange wrong return

Posted: Fri Aug 21, 2020 7:15 am
by dutch
Thank you so much, I got it.
Dutch