Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
gspirrison
 
Posts: n/a
Default Automatic Startup for a Macro

How can I automatically start a macro when a specific .xls starts up?
  #2   Report Post  
dlw
 
Posts: n/a
Default

call the macro autoexec
  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Private Sub Workbook_Open()

your code or macro name here

End Sub

To access the Thisworkbook module, right-click on the Excel logo just left of
"File" on menu.

Select "View Code".

In dialog box drop-down at top left select Workbook and the Private Sub
Workbook_Open().........End Sub will be inserted.

Copy your macro code between the Open() and End Sub lines.

Or just enter the macro name, assuming the macro is in the same workbook.

If not in the same workbook, perhaps in Personal.xls or an Add-in, go to
ToolsReferences and checkmark the reference to use.

Save/Close and reopen.


Gord Dibben Excel MVP


On Mon, 2 May 2005 14:19:11 -0700, "gspirrison"
wrote:

How can I automatically start a macro when a specific .xls starts up?


  #4   Report Post  
Gord Dibben
 
Posts: n/a
Default

dlw

In Excel in a General Module you would name it Auto_Open

In the Thisworkbook Module it would be Workbook_Open


Gord Dibben Excel MVP


On Mon, 2 May 2005 14:38:03 -0700, dlw wrote:

call the macro autoexec


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Automatic Startup for a Macro

I have code I place in In Excel in a General Module with name Auto_Open.
When I hold the shift key down, it still runs. Is there a way to turn off
with VBA code?


"Gord Dibben" wrote:

dlw

In Excel in a General Module you would name it Auto_Open

In the Thisworkbook Module it would be Workbook_Open


Gord Dibben Excel MVP


On Mon, 2 May 2005 14:38:03 -0700, dlw wrote:

call the macro autoexec





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Automatic Startup for a Macro

You sure the code runs?

Holding down Shift Key should prevent the code from running but will not
prevent the "this workbook contains macros" message.

Test with this in a new saved workbook.

Sub auto_open()
MsgBox "hello"
End Sub


Gord


On Tue, 5 Jan 2010 07:19:01 -0800, DogLover
wrote:

I have code I place in In Excel in a General Module with name Auto_Open.
When I hold the shift key down, it still runs. Is there a way to turn off
with VBA code?


"Gord Dibben" wrote:

dlw

In Excel in a General Module you would name it Auto_Open

In the Thisworkbook Module it would be Workbook_Open


Gord Dibben Excel MVP


On Mon, 2 May 2005 14:38:03 -0700, dlw wrote:

call the macro autoexec




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help? start macro automatic in excel pim_parra Excel Worksheet Functions 2 April 8th 05 02:03 PM
Run a Macro on Startup for Specific Spreadsheet Rod Excel Worksheet Functions 4 March 16th 05 08:52 PM
running macro at automatic time intervals tjb Excel Worksheet Functions 1 February 28th 05 09:40 PM
automatic macro update boconnell Excel Worksheet Functions 4 February 9th 05 07:10 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM


All times are GMT +1. The time now is 01:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"