Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do i get a macro to run when a document is closed or opened?
Cheers --- Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If the macro is in the workbook, the workbook must be open for the macro to
actually run. The true anwer would be specific to the context of how you are trying to run a macro. For instance, if you assign a macro to the onaction property of a commandbar button, then when the button is pushed, if the workbook is closed, excel will open it and run the macro. -- Regards, Tom Ogilvy "Stu" wrote in message ... How do i get a macro to run when a document is closed or opened? Cheers --- Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stu,
If you mean to have a macro run when a specific workbook is opened, name the macros Auto_Open and Auto_Close. If you mean to have a macro run when any workbook is opened or closed, you need to use application-level events. See www.cpearson.com/excel/appevent.htm -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Stu" wrote in message ... How do i get a macro to run when a document is closed or opened? Cheers --- Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well that interpretation makes more sense <g
-- Regards, Tom Ogilvy "Chip Pearson" wrote in message ... Stu, If you mean to have a macro run when a specific workbook is opened, name the macros Auto_Open and Auto_Close. If you mean to have a macro run when any workbook is opened or closed, you need to use application-level events. See www.cpearson.com/excel/appevent.htm -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Stu" wrote in message ... How do i get a macro to run when a document is closed or opened? Cheers --- Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to open, Update links, save and close workbooks | Excel Discussion (Misc queries) | |||
VBA Project - Open/Close with Macro | Excel Worksheet Functions | |||
Macro to close workbook and re-open new copy | Excel Discussion (Misc queries) | |||
Macro to Open, then Close another File | Excel Discussion (Misc queries) | |||
help with macro to open and close workbooks | Excel Programming |