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
ASKER CERTIFIED SOLUTION
Avatar of redmondb
redmondb
Flag of Afghanistan image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of redmondb
redmondb
Flag of Afghanistan image

Thanks, iamnamja. To help others who may have a similar problem, please let us know what the solution was.
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo