I try to read an Excel-table, perform tests on the data of each row (using if and switch on the values of specific colomns) and then perform an action depending on the values of the row. Finally I want to write a result in a specific column of each row.
For instance if the value of column “year” is < 2000 my result would be “Before 2000”.
I tried Read Range and then iterate through the results with For Each Row.
Then get the data with Get Row Item an write it in my predefined variables.
My problem now is the type conversion of the data. I would like to get some data as integer or Int32 and others as string values, so I can perform comparisons like mentioned above. But what I get is an object an errors, when I try to store it in an interger variable.
So, how do I store results from Get Row Item in variables of a specific type?
Or should I use a completely different strategy like Read Cell / Read Row instead of Read Range?
Extra Question: for now I use a counter variable that I increase with each itration of For Each Row to determine in which row I have to write my result. Is there a better way?
I don’t want to store my result in the data table. I want it written to the Excel file in each iteration, so I am sure I won’t lose it, if there is a problem anywhere in the workflow.
Thanks for helping!
Also I had a counter-variable that I increased with each