On Excel XP I would like for a message box to come up when exiting a
spreadsheet as a reminder to check certain items. Is this possible?
On Excel XP I would like for a message box to come up when exiting a
spreadsheet as a reminder to check certain items. Is this possible?
Hi Aardvaak,
Try:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Res As Long
Res = MsgBox("Have you...", vbYesNo)
Cancel = Res <> 6
End Sub
This is workbook event code and should be pasted into the workbook's
ThisWorkbook module:
Right click the Excel icon on the worksheet (or the icon to the left of the
File menu if your workbook is maximised) | Select View Code from the
resultant menu, and paste the code. Alt-F11 to return to Excel..
---
Regards,
Norman
"Aardvark" <[email protected]> wrote in message
news:[email protected]...
> On Excel XP I would like for a message box to come up when exiting a
> spreadsheet as a reminder to check certain items. Is this possible?
I tried this and it didn't work. It just gave me an error when I re-opened the workbook saying the macros were disabled.
Hi Chriskxp2123,
(1) Where did you put the code?
(2) When you close the workbook, did the message box appear for you?
(3) If your reponse to (2) is affirmative, did you try responding "No"?
(4) When you re-opened the file did you agree to "Enable Macros"?
(5) Are *you* Aardvark"?
---
Regards,
Norman
"chriskxp2123" <[email protected]>
wrote in message
news:[email protected]...
>
> I tried this and it didn't work. It just gave me an error when I
> re-opened the workbook saying the macros were disabled.
>
>
> --
> chriskxp2123
> ------------------------------------------------------------------------
> chriskxp2123's Profile:
> http://www.excelforum.com/member.php...o&userid=25833
> View this thread: http://www.excelforum.com/showthread...hreadid=392933
>
Thanks Norman Jones. It worked great. This was my first time in this
discussion group, I am so excited about having another avenue for information.
Aardvark
"Norman Jones" wrote:
> Hi Aardvaak,
>
> Try:
>
> Private Sub Workbook_BeforeClose(Cancel As Boolean)
> Dim Res As Long
> Res = MsgBox("Have you...", vbYesNo)
> Cancel = Res <> 6
>
> End Sub
>
> This is workbook event code and should be pasted into the workbook's
> ThisWorkbook module:
>
> Right click the Excel icon on the worksheet (or the icon to the left of the
> File menu if your workbook is maximised) | Select View Code from the
> resultant menu, and paste the code. Alt-F11 to return to Excel..
>
>
> ---
> Regards,
> Norman
>
>
>
> "Aardvark" <[email protected]> wrote in message
> news:[email protected]...
> > On Excel XP I would like for a message box to come up when exiting a
> > spreadsheet as a reminder to check certain items. Is this possible?
>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks