Hi I like to get the value of last cell in column A in a excelsheet call "Freight"" but i keep getting error message Object reference not set to an instance of an object.",..Can Help?



My image is attached as above. Appreciate your answers.

Hi there!

Have you entered the correct data table name in your read range output?
Let me know if the problem presist.

Yes. after i key in the output data table . No more error but Result is blank

HI,

Can you try the following expression?

lines = dt.AsEnumerable.Where(Function(r) r isnot Nothing AndAlso not String.IsNullOrEmpty(r(0).ToString)).Last().Item(0).ToString

Regards,

Thanks Guys, i got is solved by removing activities "read range"range A:A. However i still do not understand as the output i want is from column a.

HI,

Can you try to replace the red arrow pointed expression in the following image with the following?
(Please keep to use ReadRange)

dtData.AsEnumerable.Where(Function(r) r isnot Nothing AndAlso not String.IsNullOrEmpty(r(0).ToString)).Last().Item(0).ToString

image

Regards,

1 Like

Yes.Thank you.Yochi.
This is a solution.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.