how do i get a message to pop up when closing excel 2007

B

bobhogg

I wish to prompt a user to do something when they close excel 2007 i want a
message to pop up on closing or saving
 
F

FSt1

hi
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel as Boolean)

MsgBox("Boo!!!!")

End Sub
Private Sub Workbook_BeforeClose _
(Cancel As Boolean)

MsgBox ("Boo!")

End Sub

this is workbook code so you can call these events from the workbook module.
or substitute your message and paste into a workbook module.

Regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top