View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
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