I have an excel file, which has 2 Columns, and may sometimes have 5 rows of data or 25.
I am reading each cell 1 at a time using ‘read Cell’ function, and assigning to an appropriate variable, (idItem1, idItem2, etc) going top to bottom for Column A.
I can use that variable, (which is generic) later on with no issue if there is something in the corresponding cell. In fact I’m writing them all to an array and writing an individual message box for each item in the array to be sure I can play with the variable and I can get 5 results…
However, if it reads a cell that is blank it is throwing an exception and I can’t do a thing about it. I’ve tried giving the variable a default value but it still throws the following exception.
I need help getting around this…
Am I even going about this correctly? ; blindly reading every A1-A25 and then going from there to see if the variable has anything I can use? Or is there a way I can only have it recognize and only read the cells that have something in them?
I’m about 20% of the way through the UiAcademy, I’ve gone through the excel and data manipulation modules and I can’t figure this out.
I’ve tried an If box with conditions like, If “item.ToString.Contains” then proceed otherwise do nothing but whenever I run this I get an exception at the end.
Sorry if this is really long, I’m trying to be detailed. I’d really appreciate some help. Thanks so much.