Posted: 15 Jul 2019 15:18 EDT Last activity: 17 Feb 2021 10:12 EST
Save as Excel File
I am working with Robotics 8, and trying to create some excel templates from a master template file, the Excel connector has some new capabilities like not opening the file in order to retrieve the information, I tried using the save method but I am not able to do a "save as" as in the old excel connector, I want to avoid opening the file every time I need to create a template since the template's count can be higher than 100. Right now it takes around 14 seconds to create a template using the old connector having the original Master Template open all the time.
I would suggest directly copying the file using Windows. This is quick and can be done by adding a File.Copy method to the tool box. Select Choose Items on the Toolbox and then Pega Robot Static Members.
Then place a File.Copy block on your automation to perform the copy:
Hey Jeff thanks a lot for the suggestion, that actually worked very well, so thanks a lot!! I am facing a different issue now, once I have created the new template using the Copy File, I need to copy some cells from a "Previous quarter sheet" to the new file I have created. I am using the Excel connector to do so, and trying to export the table into a proxy to later Import the table in the new file, seems to run without errors until the Save method, I am getting the attached error message.
Attached also the automation, please let me know if there is something wrong.
I made the suggested changes and still get the outofmemory error, could it be that I am using different connectors? it seems in the example you have there you are reusing the same connector, Although I have tested the solution skipping the import portion and works, so it is something on the import that is not allowing me to save. Also these excel sheet is very big and has a lot of different formulas.
Out of memory due to large sheets is a possibility. Try closing the sheet after you have extracted the data table and then re-use the same connector. That should reclaim the memory that was used by the first sheet.
The current workbook is 30,593KB it keeps erroring at the time of saving, I tried with a fresh workbook and dummy data and that worked, so I guess when Robotics executes the Save method is not able to save the whole file because it runs out of memory? I tried the other suggestions and the same error.
Have you seen this before? let me know if you have any other suggestion.
I am not sure what the issue is, but could you start with a copy that includes all the data and then remove the data that is not needed? A spreadsheet that large should not be an issue from my experience.