![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 2
|
Is there a way to create an autoexec macro that invokes each time a file is opened. This feature is available in Access but I can't seem to find any info on an Excel version.
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Do you mean excecute a macro each time ANY file is opened or one SPECIFIC file is opened ?
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Feb 2002
Posts: 2
|
I mean when a particular file is opened.
Thank you, |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Then, do this:
Open the workbook. Right click on the little workbook icon next to the "File" menu and choose "View Code" Select, from the first dropdown, "Workbook" and from the second one "Open". Between these two lines Private Sub Workbook_Open() End Sub You can put the macro you want to execute. |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Location: Ireland
Posts: 133
|
call the macro Auto_Open if you want it to execute when you open it. If you want it to execute when you close the file (such as to autmatically save changes) call it Auto_Close.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|