I’m trying to modify a “.xls” excel file by writing a datatable in a specific range.
While i’m able to manually type the data and save the excel file normally, when this is performed usign uiPath excel write range activity (the one used in excel app scope) the data gets written, but the file does not get saved.
Things I have tried :
Used Write Cell Activity which works normally , however not a solution since the data is in bulk (multiple rows and columns)
Write Range (workbook activity , independent of excel scope) works but locks the file editing and corrupts the file (gives an error message when opened after activity execution)
Tried to save using macro (by invoking macro) but does not save the file even though no eror in macro execution occurs
Have tried using Save Excel Workbook activity and Close Excel workbook activity with same results
If file is visible, I can see that data is written, however the file remains open after excel application closes. it only closes once bot execution stops. If i try to close the file while bot is paused i get a save file data prompt from excel
I do not see any options in saveas dropdown (only .xls)
File has protected sheets which require password , however the area where i need to input data is not protected as i can manually open , edit and save the data normally
However my goal is to keep information in .xls only. if i use this approach will the formatting be preserved? more importantly, will I be able to convert it back to .xls (as that’s the requirement of the tool where i would input this file)
I was not sure but I checked. I was able to create a .XLS file using Write Range (not in the Scope) and the file is working.
So, maybe if you try open the .XLS file and Read Range in the Excel Application Scope and the rest action on DataTable do out of the Scope.
On the end, try to Write Range with .XLS extension.