ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to run macro with scheduler (https://www.excelbanter.com/excel-discussion-misc-queries/154869-how-run-macro-scheduler.html)

dan

How to run macro with scheduler
 
What is the best way to run an excel macro with the scheduler??
- is it possible to run the macro on file open?? how
- is it possible to run directly the macro as a VBA file??
- maybee another way??

thanks

Gord Dibben

How to run macro with scheduler
 
You would store the macro code in Thisworkbook module as a Workbook_Open sub
then use task scheduler to start Excel with that workbook to open.

Or store the macro in a general module and name it Sub Auto_Open() and open
workbook using task scheduler as above.


Gord Dibben MS Excel MVP

On Sun, 19 Aug 2007 08:00:01 -0700, Dan wrote:

What is the best way to run an excel macro with the scheduler??
- is it possible to run the macro on file open?? how
- is it possible to run directly the macro as a VBA file??
- maybee another way??

thanks



JLatham

How to run macro with scheduler
 
Maybe explain a little more about what you want to do?

Can you run the macro on File Open? Yes. Use the Workbook's
Workbook_Open() event process to either run the code or to make a call to the
code if written into another module. To get to the Workbook's _Open() event
section, right click on the Excel icon to the left of the word "File" in the
menu bar and choose [View Code] from the list that appears. In the lefthand
pulldown above the large code module area, choose Workbook, and
Workbook_Open() is the default 'stub' that will be started for you.

Can you run the code as a VBA file? No. The Excel file has to be open for
the code in it to be executed.

"Dan" wrote:

What is the best way to run an excel macro with the scheduler??
- is it possible to run the macro on file open?? how
- is it possible to run directly the macro as a VBA file??
- maybee another way??

thanks


dan

How to run macro with scheduler
 
Thanks - it works

"Gord Dibben" wrote:

You would store the macro code in Thisworkbook module as a Workbook_Open sub
then use task scheduler to start Excel with that workbook to open.

Or store the macro in a general module and name it Sub Auto_Open() and open
workbook using task scheduler as above.


Gord Dibben MS Excel MVP

On Sun, 19 Aug 2007 08:00:01 -0700, Dan wrote:

What is the best way to run an excel macro with the scheduler??
- is it possible to run the macro on file open?? how
- is it possible to run directly the macro as a VBA file??
- maybee another way??

thanks




dan

How to run macro with scheduler
 
thanks a lot - it works

"JLatham" wrote:

Maybe explain a little more about what you want to do?

Can you run the macro on File Open? Yes. Use the Workbook's
Workbook_Open() event process to either run the code or to make a call to the
code if written into another module. To get to the Workbook's _Open() event
section, right click on the Excel icon to the left of the word "File" in the
menu bar and choose [View Code] from the list that appears. In the lefthand
pulldown above the large code module area, choose Workbook, and
Workbook_Open() is the default 'stub' that will be started for you.

Can you run the code as a VBA file? No. The Excel file has to be open for
the code in it to be executed.

"Dan" wrote:

What is the best way to run an excel macro with the scheduler??
- is it possible to run the macro on file open?? how
- is it possible to run directly the macro as a VBA file??
- maybee another way??

thanks



All times are GMT +1. The time now is 10:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com