Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
what is the event that I have to use if I need my macro's to run whenever I
open/close my workbook? I've used "Auto_Open and Auto_Close". but, problem with this seems to be that the open macro runs when I open the workbook but, the close macro runs only when I close all the workbooks (or the Excel application) how are these handled? -- Baapi |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am not sure shy you would be having that problem. Try using the On_Open and
Before_Close events in Thisworkbook (I assume your code is currently in a standard module). -- HTH... Jim Thomlinson "Baapi" wrote: what is the event that I have to use if I need my macro's to run whenever I open/close my workbook? I've used "Auto_Open and Auto_Close". but, problem with this seems to be that the open macro runs when I open the workbook but, the close macro runs only when I close all the workbooks (or the Excel application) how are these handled? -- Baapi |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry there is a typo/goof in my post. Here is the full code stub for the
before close Workbook_BeforeClose(Cancel as Boolean) -- HTH... Jim Thomlinson "Jim Thomlinson" wrote: I am not sure shy you would be having that problem. Try using the On_Open and Before_Close events in Thisworkbook (I assume your code is currently in a standard module). -- HTH... Jim Thomlinson "Baapi" wrote: what is the event that I have to use if I need my macro's to run whenever I open/close my workbook? I've used "Auto_Open and Auto_Close". but, problem with this seems to be that the open macro runs when I open the workbook but, the close macro runs only when I close all the workbooks (or the Excel application) how are these handled? -- Baapi |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Workbook_Open()
and Private Sub Workbook_BeforeClose(Cancel As Boolean) Both in the ThisWorkbook section |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Baapi,
Your Auto_Open and Auto_Close subs should work if they're located in a standard module. Note that these are replacements for Workbook_Open and Workbook_BeforeClose events, of which neither of these events should exist if using the Auto_ run macros. HTH Garry |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
why does userform close after programming worksheet event with CreateEventProc or AddFromString | Excel Programming | |||
Worksheet close event++? | Excel Programming | |||
Worksheet close event? | Excel Programming | |||
Event Procedures: Event on Worksheet to fire Event on another Worksheet | Excel Programming |