simoncpage
Programmer
Hi all, how can I capture the beforesave method in excel on a global scale. I.e as you would in the Normal.dot document in word?
any help would be appreciated
Simon
any help would be appreciated
Simon
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public WithEvents App As Application
Private Sub App_WorkbookBeforeSave(ByVal Wb As Excel.Workbook, ByVal SaveAsUI As Boolean, Cancel As Boolean)
'Your code here to do whatever before any workbook is saved
End Sub
Dim X As New AppEventsClassModule
Sub InitializeApp()
Set X.App = Application
End Sub
Private Sub Workbook_Open()
InitializeApp
End Sub[code]
After this workbook opens, [b]any[/b] workbook saved will trigger the App_WorkbookBeforeSave event procedure. I recommend converting the workbook to an add-in, so that it runs behind the scenes and can be installed/uninstalled as needed.
HTH
Mike