Open Workbook at Specific Time

ilcaa

Well-known Member
Joined
May 25, 2005
Messages
751
Office Version
  1. 365
Platform
  1. Windows
Need to have a particular workbook open at a specific time...

I wrote this and placed it in a Personal.xls module, did not run automatically. I then placed the 2nd SUB() in the "This Workbook" and nothing. Where or how is the proper way to run this...

----------------------------
Sub Open_IndexAnalysis()

Workbooks.Open Filename:="e:\Index Analysis.xls"

End Sub
------------------------------
Sub Run_OpenIndexAnalysis()

Application.OnTime TimeValue("09:40:00"), "Open_IndexAnalysis"

End Sub
-----------------------
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
yes i have it stored in a module in the personal folder/project within VBA...
 
Upvote 0
How are you running the Run_OpenIndexAnalysis routine?
 
Upvote 0
i had it saved the Run_OpenIndexAnalysis routine in a Personal module, but it didnt run...

I then placed it in "This Workbook" in the Personal folder as well, but as a general SUB() not a workbook sub() still wont run at specific time...


my excel stays open so I dont want it to run off of a workbook open command which i now i could do..but rather not.....
 
Upvote 0
If you just want to open a workbook at a specific time each day, you might look at using the Windows Task Scheduler. Alternatively if your Excel never closes, you need the OpenIndexAnalysis routine to open the workbook then reschedule itself.
 
Upvote 0
How about just using Windows tools :)

Go to Start -> All programs -> Accessoires -> System tools -> Scheduled Task
Add Scheduled Task
Complete the wizard

If you have multiple files to open at the same time, it's not handy to use several tasks. I'd prefer using a batchfile:

Open notepad, type this:
Code:
cd "E:\"
Index Analysis.xls
-maybe other files-
Save as...
"Open.bat" (with the ")

And put the Open.bat in Scheduled tasks.

Edit: Rorya just beat me to it ><
 
Upvote 0
sounds like an option to use windows scheduler but it asks you for a username/password which is fine...BUT, from my experience once i reboot windows I need to log-in with a username/password....I use this computer remotely so i will lose my connection and the remote software wont start up with windows..

is there a way around using a username/password for windows but still using the scheduler??
 
Upvote 0
Yeah fair point, it's not possible without a user/pass because a non-existent user doesn't have rights on the computer.
Giving the username/password to the Scheduler does not make you lose your connection or reboot windows afaik. It's just a way for Windows to see with which user it has to run the task.

No harm in trying right?
 
Upvote 0
true it doesnt cause any of those events, but if i have to reboot for what ever reason i screwed... ill run it off the open workbook event for now

thanks
 
Upvote 0

Forum statistics

Threads
1,213,550
Messages
6,114,265
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top