Link to home
Start Free TrialLog in
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!
ASKER CERTIFIED SOLUTION
Avatar of redmondb
redmondb
Flag of Afghanistan 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
Thanks, iamnamja. To help others who may have a similar problem, please let us know what the solution was.