![]() |
Worksheet close event
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 |
Worksheet close event
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 |
Worksheet close event
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 |
Worksheet close event
Private Sub Workbook_Open()
and Private Sub Workbook_BeforeClose(Cancel As Boolean) Both in the ThisWorkbook section |
Worksheet close event
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 |
All times are GMT +1. The time now is 10:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com