Cheers guys,
My project looks like this: My robot receives, via an API call, multiple .xlsx files that contain 2 columns: A and B. Column A stays the same for all Excel files, but Column B changes for each file. The number of rows stay the same for both columns. What I need to do is: Copy the entire Column B out of each file received via the API call and dynamically paste it within the master excel file. The master excel file looks like this : Column A stays the same (it’s the same as in all received files) and starting with Column B, this file needs to get populated with each of the received files’ Column B. So, the first received file will paste it’s column B to the master’s column B. The 2nd received file shall paste its Column B contents to the master’s Column C, and so on.
I appreciate this might be a bit confusing, so I am going to attach a screenshot. I apologize in advance for my paint skills
Going back to the problem. I have managed to actually paste information dynamically, using a variable that stores the column index and increases it by one after each column is being copied.
The code I used in the ‘Range’ : (Convert.ToChar(64 + int_ColumnIndex)) + “1” where int_ColumnIndex starts with a default value of ‘2’ (so as to start with the ‘B’ column)
The issue I have is the robot throws an error when reaching Column AA of the master file. It copies information to the ‘Z’ column and then throws an error. I suspect this has something to do with the fact that the conversion (within the range) doesn’t work properly anymore when the alphabet ends.
Do you guys have any idea on how to handle this? Is there a better way to dynamically copy the columns?
Thanks in advance,
Alex