Article ID: 184707
Article Last Modified on 6/17/2005
' Specifies the procedure to run when the workbook is saved
Sub SetSaveEvent()
ActiveWorkbook.OnSave = "SaveProcedure"
End Sub
Sub SaveProcedure(s As Boolean)
MsgBox "Microsoft Excel will now save your work."
End Sub
Run the SetSaveEvent macro. This sets an internal flag in Microsoft
Excel to run the SaveProcedure macro automatically when the active workbook
is saved.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
a = MsgBox("Do you really want to save this workbook?", vbYesNo)
If a = vbNo Then Cancel = True
End Sub
176476 OFF: Office Assistant Not Answering Visual Basic Questions
Additional query words: XL98
Keywords: kbprogramming kbprb kbdtacode KB184707