Scheduling a Macro.

DaniExcel

New Member
Joined
Jan 13, 2014
Messages
15
Hi All,

I have had a look and can't see that this has been answered before so hopefully someone can help.

I have written a Macro and it's working great. I now need to schedule it to run at 12:00, 14:00 and 16:00 each working day, automatically.

I will need the macro to open the file, run the macro I have already written and then close the file.

Thanks in advance for your help.

Dani.

oh ps, I am on Excel 2013 and VBA v7.0
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
You can use the task scheduler on your machine to open the file....look in programs or google further how to do this...it's quite easy
Have to macro run automatically on opening the file ....Sub Workbook_Open ()
Then have your last action in the macro to be close and save.
 
Upvote 0
You can use the task scheduler on your machine to open the file....look in programs or google further how to do this...it's quite easy
Have to macro run automatically on opening the file ....Sub Workbook_Open ()
Then have your last action in the macro to be close and save.


Hi,

Thanks for your reply.

I am struggling to find anything that is making sense, I don't suppose you have alink?

Also, preferably, I don't want to have to open the workbook myself, just for it to open and run at the specified time. Is this possible?

Thank again,
Dani.
 
Upvote 0
Read this Starting excel file with task scheduler and you will be able to schedule your PC to open the file at specified times.

If you call your macro Sub Workbook_Open () it will run automatically when the file is opened

Put this piece of code at the end of your already writtn code and it will save and close the file
ActiveWorkbook.Close SaveChanges:=True
 
Upvote 0
Brilliant, got it!

Thanks so much. I was thinking that Scheduler was an Excel feature and so couldn't find it.

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,215,329
Messages
6,124,302
Members
449,150
Latest member
NyDarR

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