Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found the below code posted around Nov 2005:
In a new Class module name clsXLEvents Option Explicit Private WithEvents xlApp As Excel.Application Private Sub Class_Initialize() Set xlApp = Excel.Application End Sub Private Sub xlApp_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox "Tada" End Sub In a standard module named whatever Option Explicit Public xlApp As clsXLEvents And in ThisWorkbook Option Explicit Private Sub Workbook_AddinInstall() Set xlApp = New clsXLEvents End Sub Private Sub Workbook_AddinUninstall() Set xlApp = Nothing End Sub Private Sub Workbook_Open() Set xlApp = New clsXLEvents End Sub --- My question is is there a way to make a global Workbook_Open code? I tried adding: Private Sub xlApp_Workbook_Open(ByVal Wb As Workbook) MsgBox "Open" End Sub In 'clsXLSEvents', but to no avail. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formatting not saved when file re-opened | Excel Discussion (Misc queries) | |||
How do I recover excel file opened through email and not saved | Excel Discussion (Misc queries) | |||
Determine if XL file opened from Outlook or a saved file | Excel Programming | |||
Excel file opened as read-only, if saved by another user | Excel Discussion (Misc queries) | |||
Excel vba code disappears when saved workbook is re opened | Excel Programming |