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 Changing "Cancel" in SaveAs

Hello All,

Since Im employing the HidingWorksheets / ForcingMacros solution, I
have to ensure that on close the formats are restored and worksheets
Hidden/MadeVisible.

Im trying to force a SaveAs on close too, since the users will probably
have double-clicked as an attachment from an email and wont know to
save to the network.

Unfortunately, after pressing [x] and answering "Yes" to the prompt, if
they then cancel the SaveAs, the macro still runs to completion and
quits excel. Is there any way to make "Cancel" from the SaveAs dialog
Exit the Sub?

Many Thanks,
Eddie


Code below:

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Dim closercheck As Long

closercheck = MsgBox("Would you like to save before quitting Excel?",
vbInformation + vbYesNoCancel)

Select Case closercheck

Case Is = vbYes
Application.ScreenUpdating = False
Call restoremacros
Application.DisplayAlerts = False
Application.Dialogs(xlDialogSaveAs).Show
Application.Quit

Case Is = vbNo etc...


---
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
MACRO: Selecting "Cancel" from a drop down to copy and paste entirerow to another sheet Nicole Hannington Excel Discussion (Misc queries) 1 July 20th 09 07:11 PM
MACRO: Selecting "Cancel" from a drop down to copy and paste entirerow to another sheet Nicole Hannington Excel Worksheet Functions 1 July 20th 09 06:51 PM
How do I stop "global" hyperlinks changing to "local" links? Em Excel Worksheet Functions 2 August 26th 08 01:18 PM
Excel: Changing "numeric $" to "text $" in a different cell. Heather_CCF Excel Worksheet Functions 1 September 5th 06 06:06 PM
Changing "returned" values from "0" to "blank" LATATC Excel Worksheet Functions 2 October 20th 05 04:41 PM


All times are GMT +1. The time now is 11:59 PM.

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

About Us

"It's about Microsoft Excel"