A
Aidy
I'm tring to hide a column before I save the workbook. So I'm using
the 'WorkbookBeforeSave' event method.
I've put this in the class module
Public WithEvents App As Application
Public Sub App_WorkbookBeforeSave(ActiveWorkbook, _
ByVal SaveAsUI As Boolean, Cancel As Boolean)
Columns("D").Select
Selection.EntireColumn.Hidden = True
End Sub
And this in a normal module
Public Ev As ClsEvents
Sub SaveAndHideCols()
Set Ev = New ClsEvents
Ev.App_WorkbookBeforeSave ActiveWorkbook, False, False
End Sub
However, when I press save, the code within the event method is not
activated.
What am I doing wrong?
Cheers
Aidy
the 'WorkbookBeforeSave' event method.
I've put this in the class module
Public WithEvents App As Application
Public Sub App_WorkbookBeforeSave(ActiveWorkbook, _
ByVal SaveAsUI As Boolean, Cancel As Boolean)
Columns("D").Select
Selection.EntireColumn.Hidden = True
End Sub
And this in a normal module
Public Ev As ClsEvents
Sub SaveAndHideCols()
Set Ev = New ClsEvents
Ev.App_WorkbookBeforeSave ActiveWorkbook, False, False
End Sub
However, when I press save, the code within the event method is not
activated.
What am I doing wrong?
Cheers
Aidy