Run xlsm Macro in the middle of night

W

whytheq

Hello,

I've got several macros which we would like to run in the middle of
the night - anyone got any suggestions of the best way of automatcally
running them? Use the OnTime method? problem is a macro still needs to
be run. Just wondering if a stored prodecdure on a sql server would be
capable of creating an event which could run the macro?


Any help much appreciated.

J
 
P

Per Jessen

Hi

You could use a Workbook_Open event to call OnTime method. Of course the
workbook has to be open.

Hopes this helps.

//Per
 
P

Patrick Molloy

use the windows task scheduler - set it to run the desired workbook at the
appropriate time.
in the workbook, make sure that you use the workbook open event to start
your sub, or have a sub name Auto_open
 
D

Dave Peterson

And to add to Patrick's response...

Make sure your security settings are set to allow macros to run. You wouldn't
want to check the next morning to find that excel is prompting you to see if
macros should be enabled.
 
D

Dave Peterson

I don't think that the workbook has to be open for this. Excel will find the
workbook with that ontime macro and open it if it needs to.

But the excel application does have to be kept open.
 
W

whytheq

use the windows task scheduler - set it to run the desired workbook at the
appropriate time.
 in the workbook, make sure that you use the workbook open event to start
your sub, or have a sub name Auto_open









- Show quoted text -


ok - I've not used the Windows Task Scheduler before.....where do I
start; do you have any links to help a newby with the scheduler. What
will I be scheduling? Opening the wkbk? this will then fire the
Workbook_Open Ontime routine (I'm fine with this part of the answer as
I regularly use this event and this method)........ or will I be
scheduling an actual reference to the macro in the workbook?

thanks for all the help so far

Jason.



Jason.
 
P

Patrick Molloy

you'll find the windows scheduler in the Control Panel in Administrative
Tools
add a new task and set the action to open the workbook. You set the
Auto_Open procedure or use the workbook_Open event...you know how already
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top