Auto launch application & run macro

G

Guest

Hi everyone,
I want to schedule my macro to run daily at 5:00 am. From reading thru the
threads, I believe I need to record a Sub Auto_Open to launch the Excel
application and to then run the macro? In setting up the scheduled task, the
wizard will ask for the application. How do you designate the vba code to
run? Thanks for all the great knowledge y'all have provided for novices like
me!
Cheryl
 
G

Gord Dibben

Cheryl

Sub Auto_Open does not launch Excel.

Windows Task scheduler starts Excel at the given time with your workbook to
open.

The Sub Auto_Open() runs the code when the workbook opens.


Gord Dibben MS Excel MVP
 
G

Guest

Ok, what is the easiest method to run a macro as an unattended task w/o
opening Excel?

Thanks,
Cheryl
 
N

NickHK

Cheryl,
Not possible; Excel must be open for macros to run.
As Gord says, you can use the Windows Scheduler to open an Excel file at the
required time.
Code in the Auto_Open routine (or preferably the Workbook_Open event) will
then run.

NickHK
 

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