Popup when saving or closing

  • Thread starter Thread starter rglasunow
  • Start date Start date
R

rglasunow

I would like to have a popup window appear when a user either closes o
saves a document in Excel. Is this possible?

thank you,
 
Yes it is. You would put your code in the Before Workbook Close even
and/or Before Workbook Save event.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox "Have a nice day!", vbOkOnly
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel A
Boolean)
MsgBox "Your workbook has been saved.", vbOkOnly
End Sub

You can put what ever you want in the quotes.

Hope this helps you out
 

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

Back
Top