cancel
Showing results for 
Search instead for 
Did you mean: 

MS Excel VBO - "File already in use" on saving workbook

JoaoMolina
Level 4
Hello, we are facing a weird problem while saving excel workbook.

Basically we have a lot of robots saving excel in a common share but each saving their own excel. There's no chance other user/bot is using the same excel. When we preform the "save workbook"  action sometimes (like 50 or 60% of the times) we get na excel pop up saying "file is curently in use" wich just puts the VM in "warning".

We belive this is something about the 30 secs timeout which is hardcoded on the object but we are not sure. Any idea about this?

------------------------------
Joao Molina
Intelligent Automation CoE leader
Millennium BCP
Europe/London
------------------------------
5 REPLIES 5

ElifKaraoglu
Level 2
It seems like you are trying to open already open excel.
You should try to kill excel process in task manager before reopen again the same excel.
Before starting to work with excel use this;
Utility- Environment-> Kill Process, Process name=" EXCEL"
Also you should use kill process after you finished excel jobs. Close instance dont kill excel.exe.You should use kill process.

or maybe you are using wrong handle value for save workbook object.

------------------------------
Elif Karaoglu
------------------------------

SamAssaf
Level 3
Hi Joao,

I've experienced something similar. When you say "common share", are you referring to a OneDrive folder or is it a mounted network folder?

------------------------------
Sam Assaf
Senior
EY
Montreal QC
------------------------------

Hi. 

Have you found a solution? I have a process that opens an excel file which is stored in a mounted network folder. 50% of the times we get an excel pop up saying "file is curently in use" that puts the VM in "warning".

------------------------------
Sondre Dahl
------------------------------

no not really... we belive it's related to the capacity of our mounted share speed of writing. The more bots try to write, the more the problem prevails...

------------------------------
Joao Molina
Intelligent Automation CoE leader
Millennium BCP
Europe/London
------------------------------

Hi Sondre 

When you say other bots are using this file are they all using different vm's but accessing the same file? Are they all running separately and could be attempting to access the file at the same time? If so then you could try using the environment locking action in BP this will allow only one process to open the file and use it at a single time. When complete the bot should save the file, close the instance, exit (all of these actions are within the excel object) this will close any open instances and exit the open excel application, you then release the environment lock to allow another process to use the file. 

However if you think this is just a result of the save taking too long to save the file you could change the timeout period on this, the save objects has the timeout period as 30 seconds in a data item. If you change the data item to a longer time limit you dont need to change anything within the code stage itself just the data item.

Hope this helps 🙂

------------------------------
Michael ONeil
Technical Lead developer
Everis Consultancy
Europe/London
------------------------------