Having an issue during my ForEachRow activity. I have successfully captured the text I want via GetText (I used a message box to confirm and each time it looped a new message box with the info popped up) and assigned it a variable. What I now want to do is input that data into the same row but in a different column.
I tried using WriteCell using “Sheets1” - row(2) and then the variable for the input. It kept throwing an error “Option Strict On disallows implicit conversions from ‘Object’ to ‘String’” so I tried row(2).ToString, still no effect.
Hi
I would like to suggest one thing
—as you are using for each row loop probably you will be iterating through each row one by one in a DATATABLE obtained from that excel
—so let’s say like we can update in that excel with simple assign activity and then upload that datatable to the excel where we want the data to be written which is more feasible and robust, without using get text or write cell activities
—and steps involved are
—use a excel application scope and pass the file path as input
—use a read range activity and get the output with a variable of type datatable named outdt with which we are going to moderate and upload the same to the excel in return
—now use a for each row loop and pass the above datatable variable as input
—inside the loop we can use a assign activity like this to add a value in the same but of different column row(“yourcolumnname”) = “value we want”
Or row(columnindex) = “value we want”
Simple isn’t it
Hope this would help you
Kindly correct me if IBM wrong with the question and let know for any queries or clarification
@Palaniyappan thank you for your response. Im not quiet sure I follow. I have an external program that I am using to run the data from row(0). In the program I do not have a way to scrape for a data table and I can only run one query in the program at a time.
So right now I have:
Excel Scope
Read Range
ForEachRow
AttachToWindow (for the app I need to use)
TypeInto (where Im using row(0).ToString)
SendHotkey (to start query)
GetTexts (9 total)
And then I run into my issue of not having a way to export those variable from the the GetText back into the excel file.