Excel: operations with rows and columns
Posted: Thu Oct 24, 2024 3:32 pm
Hi,
I am having a couple of difficulties with Excel which I am not sure how to overcome.
1.
I need to be able to delete first 30 rows in each of few hundreds of XLSX files. Unfortunately, there is no Robotask command 'Excel Delete Rows'. I tried using a macro, but for some reason Robotask cannot find the macro in each file's workbook. And indeed, the macro, although is present on the list of macros for Excel in general, is not added to each Workbook on each file specifically. Obviously, opening each file and adding the macro to each workbook manually defeats the purpose of automation and is not doable for hundreds of files. Also, using a macro which consists of just one action feels unproductive.
Probably, it could work if I had a way to add the code of the macro into the task and then task Robotask with applying it to each file externally, so to speak, not by running already existing macro from within. Or if I could save the macro as a file and provide the file's location. But currently Robotask only takes macro's name.
2.
I need to compile a summary Excel file by copying some of the cells from each of hundreds of Excel files into it. Unfortunately, Robotask can open only one Excel file at a time. So, at each iteration I have to close the summary file and then open it for the next. I think this wastes time and resources. Is there a way to open more than one Excel file at a time?
For now I am thinking of firstly saving each of the source files as CSV and after that read them into that summary XLSX.
Possibly conversion to CSV could help with the first problem above, but I cannot see 'CSV Remove Row', only 'CSV Remove Column' is there.
I am having a couple of difficulties with Excel which I am not sure how to overcome.
1.
I need to be able to delete first 30 rows in each of few hundreds of XLSX files. Unfortunately, there is no Robotask command 'Excel Delete Rows'. I tried using a macro, but for some reason Robotask cannot find the macro in each file's workbook. And indeed, the macro, although is present on the list of macros for Excel in general, is not added to each Workbook on each file specifically. Obviously, opening each file and adding the macro to each workbook manually defeats the purpose of automation and is not doable for hundreds of files. Also, using a macro which consists of just one action feels unproductive.
Probably, it could work if I had a way to add the code of the macro into the task and then task Robotask with applying it to each file externally, so to speak, not by running already existing macro from within. Or if I could save the macro as a file and provide the file's location. But currently Robotask only takes macro's name.
2.
I need to compile a summary Excel file by copying some of the cells from each of hundreds of Excel files into it. Unfortunately, Robotask can open only one Excel file at a time. So, at each iteration I have to close the summary file and then open it for the next. I think this wastes time and resources. Is there a way to open more than one Excel file at a time?
For now I am thinking of firstly saving each of the source files as CSV and after that read them into that summary XLSX.
Possibly conversion to CSV could help with the first problem above, but I cannot see 'CSV Remove Row', only 'CSV Remove Column' is there.