ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Automatically run an Excel macro (https://www.excelbanter.com/excel-discussion-misc-queries/217234-automatically-run-excel-macro.html)

sxhwabbiemike

Automatically run an Excel macro
 
I have an Excel macro theat I would like to automatically run using Windows
XP Scheduled Tasks.

Is this possible...if I could invoke the macro via a BAT or CMD file that
would be great.

bpeltzer

Automatically run an Excel macro
 
Put your code in a subroutine named Auto_Open, then use the task scheduler to
open your Excel file. Be sure your macro security is such that your macro
can run without any prompts.

"sxhwabbiemike" wrote:

I have an Excel macro theat I would like to automatically run using Windows
XP Scheduled Tasks.

Is this possible...if I could invoke the macro via a BAT or CMD file that
would be great.


sxhwabbiemike

Automatically run an Excel macro
 
I did that, however whenever I try t view the file that was created by the
macro it reruns the macro.

I woould like to save the file to a common site (iKnow) for viewing by
others without it being recreated each time someone wants to view it.

"bpeltzer" wrote:

Put your code in a subroutine named Auto_Open, then use the task scheduler to
open your Excel file. Be sure your macro security is such that your macro
can run without any prompts.

"sxhwabbiemike" wrote:

I have an Excel macro theat I would like to automatically run using Windows
XP Scheduled Tasks.

Is this possible...if I could invoke the macro via a BAT or CMD file that
would be great.


bapeltzer

Automatically run an Excel macro
 
There are several ways you could allow the macro to start automatically (via
the Auto_Open) and conditionally exit before it runs... For your purposes,
it sounds like you might just check the path (activeworkbook.path) and exit
if it's not your local copy. Also, FYI, if the file is found via File
Open, then shift-click will open the file without executing the macro (vs
clicking on Open which will open and execute).

"sxhwabbiemike" wrote:

I did that, however whenever I try t view the file that was created by the
macro it reruns the macro.

I woould like to save the file to a common site (iKnow) for viewing by
others without it being recreated each time someone wants to view it.

"bpeltzer" wrote:

Put your code in a subroutine named Auto_Open, then use the task scheduler to
open your Excel file. Be sure your macro security is such that your macro
can run without any prompts.

"sxhwabbiemike" wrote:

I have an Excel macro theat I would like to automatically run using Windows
XP Scheduled Tasks.

Is this possible...if I could invoke the macro via a BAT or CMD file that
would be great.



All times are GMT +1. The time now is 12:19 AM.

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