Execute Macros : Document was not saved

Hello, I have a macros enabled excel template where I paste the data during run time & use UiPath’s activity ‘Execute Macros’ to kick start the Macros run.

Until now it was working fine in my Dev VDI but when moved to production VDI I started getting the below error.


Has anyone faced this before?

Any suggestions would be very helpful.


Hi @Faraz_Subhani

Could you double check if the file is not set to read only mode?

Thanks for your suggestion, I checked it, file is not set to read only, sorry for late response, I was trying some other solutions, someone suggested to re record macros in the production VDI to fix the issue, I did that but issue still persists.

Shockingly, for e.g. I have given retry as 3 for my queue items, it will fail for first 2 times but will be successful the last time, surprisingly every time this is the pattern which it follows.
To add to that I never faced this issue while developing & testing in Dev VDI.
Please throw some light on this, @Palaniyappan any suggestions from you as well will be very helpful.

@loginerror @Palaniyappan Below is my screen shot, error occurs in ‘Execute Macros’ activity.

I am confused as to whether this error is related to excel or Macros, probably some issue while saving the excel sheet, Autosave is checked by default for my excel application scope, could that be the issue but never occurred in Dev VDI.

1 Like

Try like this
—keep the above excel application scope till write range activity and remove that execute macro

—then use a kill process activity and mention the process name as “excel”

—again use a Excel application scope and pass the same file path and there include execute macro and try

I hope this might have occurred as the excel file used with macro immediately after the write range

Kindly try this and let know for any queries or clarification

Cheers @Faraz_Subhani


Thanks a lot, it worked, great as always, please keep up the good work.:slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.