[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

TASK SCHEDULER PROBLEM

Posted on 2007-11-21
10
Medium Priority
?
174 Views
Last Modified: 2010-04-13
Hello,

I have a task scheduler that is set to run every morning before I get into work. It is designed to close down any excel spreadsheets that may be open. When I arrive and check I can see that it has not worked but when I change the time and watch to see if the task scheduler works it does. Please could someone advise?

Thanks,

f19l
0
Comment
Question by:f19l
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 12

Expert Comment

by:RubenvdLinden
ID: 20326714
Is your computer on stand bye when it's supposed to run?
If so, you have to change the power management settings on the Settings tab (right-click your task, click Properties).
0
 

Author Comment

by:f19l
ID: 20326733
I leave the computer on overnight. I also have other task schedulers active as well and they seem to run just fine. The basic arrangement is that one task scheduler will open up an excel spreadsheet which will then run various processes followed by a second scheduler that will save and close down excel. The first one works without any problems but the second one does not for some reason.
0
 
LVL 12

Expert Comment

by:RubenvdLinden
ID: 20326821
Have you tried configuring this in an Excel macro which performs the tasks, saves the file and then exit the program?
This would make the second task scheduler obsolete and might help you around the problem.
0
What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

 

Author Comment

by:f19l
ID: 20326844
The problem is that part of the processes in the excel spreadsheet involve establishing links to the Bloomberg financial system and this can not happen while macros are being run otherwise "#N/A" starts appearing in the cells. The spreadsheet has to be left for a few minutes after the macros have run so that the links can be properly updated. After this is done the task scheduler is then set to save and close down the spreadsheet.
0
 
LVL 12

Expert Comment

by:RubenvdLinden
ID: 20326996
OK, open your workbook and go to the macro editor.
Next, double-click on 'ThisWorkbook' in the project pane and add this code:

Private Sub Workbook_Open( )
    Application.OnTime TimeValue("6:00:00"), "EndMacro"
End Sub

Private Sub EndMacro()
    Application.OnTime TimeValue("6:00:00"), "EndMacro"
     
    ActiveWorkbook.Save
    Application.Quit
End Sub


This example will schedule the sub EndMacro to run at 6:00, as long as the spreadsheet is open.
EndMacro saves the active workbook and quits Excel.
0
 

Author Comment

by:f19l
ID: 20327145
I have followed the coding you have above but I get an error message "The macro 'file address'!ENDMACRO' cannot be found". What I have done is that in the workbook_open page, where I have a number of if statements that check the time before running the associated code, I have incorporated your above-mentioned code into one of the if statements. Next, directly below the workbook_open section I have added the private sub EndMacro code.
0
 
LVL 12

Accepted Solution

by:
RubenvdLinden earned 2000 total points
ID: 20327172
Sorry my mistake, it should be:

Application.OnTime TimeValue("6:00:00"), "ThisWorkbook.EndMacro"

You need to replace both lines with this one.
I hope it will work for you now!
0
 

Author Comment

by:f19l
ID: 20327246
It does in deed but what I want to do now is to test it tomorrow morning for real and see if everything works ok before I close this question.
0
 
LVL 12

Expert Comment

by:RubenvdLinden
ID: 20327269
No better test than a production test ;-)
I'm very interested in your results!
0
 

Author Comment

by:f19l
ID: 20333246
Everything seems to be running as expected! Thanks.
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
What monsters are hiding in your child's room? In this article I will share with you a tech horror story that could happen to anyone, along with some tips on how you can prevent it from happening to you.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question