Avatar of iamnamja
iamnamja
 asked on

Scheduled task errors out, but opening excel does?

Hi,

I have a macro in Excel set to auto run through the windows scheduler.  The macro seems to run fine when I run it by opening it manually (it envokes the macro through open workbook)

But when I run it from the scheduler, I get the following error:
XXXXX.xlsm is already open.  Reopening will cause any changes you made to be discarded.  Do you want to reopen XXXXX.xlsm?

I tried to identify where the error is...  and it seems to occur when I call a function by doing application.ontime in the macro.

I do this because I'm running the macro in bloomberg, and I need a way to "let go" of the macro, and keep checking to see if the values are populated... And when they are, it will call another function to complete the macro and close out the excel sheet.

Any idea how I can go about fixing this?  I need this to run automatically, but this is stalling the macro.  Possibly there's another way to run this similar to opening the sheet manually?  Thanks!
Microsoft ExcelMicrosoft DevelopmentMicrosoft Applications

Avatar of undefined
Last Comment
redmondb

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
redmondb

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
redmondb

Thanks, iamnamja. To help others who may have a similar problem, please let us know what the solution was.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes