Link to home
Start Free TrialLog in
Avatar of Tessando
TessandoFlag for United States of America

asked on

How To Prevent Multiple Instances of Excel.exe Running at the Same Time

I have a Scheduled Task that runs every 4 hours. This Scheduled Task does some Reporting automation in that it opens up an Excel doc, updates some cells from an Access database and ultimately pushes those changes to some Pivot Tables.

Over the weekend, four instances of Excel were running, likely from the process taking longer than expected. This caused a Memory issue, with the "Resource Exhaustion Detector" showing in the Event Viewer.

This process has ran flawlessly for years (e.g. without multiple instances of Excel showing in the Task Manager).

Is there a way I can programmatically limit the number of processes of Excel that are running? Meaning, is there a directive (or "switch") I can put in the Scheduled Task so that it stops after 3.5 hours? I'm open to suggestions to fix this one.

Thanks!
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Meaning, is there a directive (or "switch") I can put in the Scheduled Task so that it stops after 3.5 hours?

yes, there is

User generated image
Ryan, provided a way, but without what the task is that is running this long, a termination of the task could have undesired consequences.

Often things build up overtime. I.e. There is much more data now compared to originally.
Unless you can narrow, reduce the data the excel has to process, or use a newer option using ...

Narrowing, reducing the range of data ...
ASKER CERTIFIED SOLUTION
Avatar of MURUGESAN N
MURUGESAN N
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial