Startup with a Macro

  • Thread starter Thread starter SA
  • Start date Start date
S

SA

From a command line I need to start Excel, open a specific
Excel file, execute a macro in that file and then close
the file with a save. This is to be done only at specific
times and not every time I open the Excel file.
Is there a command line option to start an Excel macro
like the one they have in ACCESS.
Any help would be appreciated.
 
Hi
you could rename your macro to
Auto_Open()

or put the code in the workbook event
workbook_oen()
 
I'm not sure what you mean by "from the command line"? At
the time you want to execute this "open-run-close" sequence
are you sitting looking at your spread sheet, or is this
supposed to happen within a macro that's executing? If you
are looking at the spreadsheet and decide tro initiate the
sequence, are you willing to press a button (like one
created with an AutoShape rectangle) that has a macro
assigned to it?
 
This is what I am trying to do:
- I have a Workbook with a two macros that perform
different actions on the same worksheet.
- I need to schedule the execution of the macros at two
different time T & T+X.
- I am thinking of using Windows scheduler to do this.
- At time T Scheduler executes "Open file - Execute Macro1
and Close file".
- At time T+X Scheduler executes "Open file - Execute
Macro2 and Close file".
- The Macros are to be executed without any external
interference. They are to be time triggered by the
scheduler.
 

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

Back
Top