Read Sheet1 : Non-negative number required. (Parameter 'lengths[0]')

Getting error while reading Sheet1 from Cell “P9:P”+RowCount.ToString. Mostly all cell values are 0.

How an I solve this ?

Thanks

@Pal_Patel

Is the row data read from p9 only?

And is the rowcount coming as 0 can you print and check

Cheers

It is giving me error. Not reading any rows. But The rows values are 0. so don’t know what is causing problem.

@Pal_Patel

That is the issue right…if row count is zero either dtaa is filtered or not read checkt hat

Cheers

Row Count not zero. Values of the cells are 0.

Where is RowCount coming from? That’s probably where your issue is. What’s the value of RowCount when you’re getting the error?

@Pal_Patel

Value of cell kight not effect…can you check what is the row count you are getting…may be the rowcount needa to be added with 9

Cheers

Hi, IF I read the rows like “P:P” It gives Error – Line Items sheet_AN: Invalid row number (65536) outside allowable range (0…65535).

But actual rows on the sheet is 1161.

@Pal_Patel

P:P might not work and yes…did you even print what you are getting as rowcount?

cheers

No, you mean to get the row count?

@Pal_Patel

Can you use a log message and print rowcount and show

cheers

Yes, Rowcount is 1160. Without header, so thats corerect.

image

@Pal_Patel

"P9:P" + (9 + RowCount).ToString

can you try the above

and please show the activity screenshot if possible

Also try changing display format options or preserve format options

cheers

Ok, Let me try that. Also I don’t want to read it from 9th row now, I want all rows.

When I am reading Only P column P:P it gives more rows but there is data through only 1161 rows.
image

@Pal_Patel

Yes P:P will read full only

cheers

Got it. I used row count to read the actual rows with particular column. Working. Thanks

1 Like

@Pal_Patel

Glad it helped

cheers