LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default WorkBook_BeforeClose (Delete Menu)

Hi Ya'll,

I have a code that works like excels "save workbook before closing"
except it will stop my commandbar from being deleted if the user click
on cancel.. My problem is that I am getting a "Variable not defined
error. Not sure what I missed with the code.. I am following the cod
from a book and the code is exactly how the book has it...

Does anyone see anything wrong with my code?
Any help will be appreciated...

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Not Me.Saved Then
Msg = "Do you want to save the changes you made to "
Msg = Msg & Me.Name & "?"
Ans = MsgBox(Msg, vbQuestion + vbYesNoCancel)
Select Case Ans
Case vbYes
Me.Save
Case vbNo
Me.Saved = True
Case vbCancel
Cancel = True
Exit Sub
End Select
End If
Call DeleteMenu
End Sub

Thanks,

Rockee

Excel 2003 (11.0

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Workbook_BeforeClose Ed Davis[_2_] Excel Discussion (Misc queries) 21 September 26th 09 01:01 AM
Workbook_BeforeClose Question Sashi Excel Worksheet Functions 7 July 26th 07 08:36 PM
help me. How to delete a menu H. Lima Excel Discussion (Misc queries) 3 July 3rd 05 09:14 PM
Workbook_Beforeclose vs BeforeClose Event Juan Pablo González Excel Programming 3 February 2nd 04 12:17 AM
Workbook_BeforeClose Event Shatin Excel Programming 2 January 24th 04 03:50 AM


All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"