LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default VBScript to prompt Save on Cancel click

Private Sub cmdCancel_Click()

If MsgBox ("Save document?,vbYesNo) =vbYes Then
ActiveWorkbooks.Save
End If

Unload Me

End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"paperclip" wrote
in message ...

Hello everyone!

I am dabbling in some VBScripting and created a simple form. What I
want to do is add an extra couple of code for the CANCEL button so that
when its clicked it will prompt the user to save the document - whether
they have changed it or not (cos I figure its easier that way!).

This is all the code i have for the cancel button:

Code:
--------------------
Private Sub cmdCancel_Click()

Unload Me

End Sub
--------------------


Any help on this would be much appreciated.

Regards.


--
paperclip
------------------------------------------------------------------------
paperclip's Profile:

http://www.excelforum.com/member.php...o&userid=32219
View this thread: http://www.excelforum.com/showthread...hreadid=566739



 
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
Cannot seem to Cancel EXCEL App Right Click Event using C# Nick Biggs Excel Programming 18 October 28th 09 08:16 AM
save prompt for user exit, but no save prompt for batch import? lpj Excel Discussion (Misc queries) 1 February 25th 06 02:08 AM
Save an excel file in vbscript without user prompt [email protected] Excel Programming 2 January 18th 06 03:48 PM
How to CANCEL file SAVE PROMPT when MACRO is running? Stuart Macro Muppet Excel Discussion (Misc queries) 3 August 11th 05 12:26 PM
Cancel Macro is user selects 'cancel' at save menu Mark Excel Programming 1 April 6th 05 05:45 PM


All times are GMT +1. The time now is 08:21 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"