Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message Box Prompt
I have a code running behind a button which, once pressed, saves the workbook
in a specified directory. Now, I want to give the users the option to cancel the action. Therefore, I want a message box that tells the users that if they click on "OK", the file will be saved in a particular directory, but if they don't want the file getting saved, they should press "CANCEL". I want to create a message box which does the following: If user clicks "OK", the workbook closes. If user clicks "Cancel", the workbook remains open. How can I code this? Thanks, in advance, for your help. -Yasser |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message Box Prompt
If MsgBox("OK To Save",vbOKCancel) = vbOK Then
Activeworkbook.Close End If -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "yasser" wrote in message ... I have a code running behind a button which, once pressed, saves the workbook in a specified directory. Now, I want to give the users the option to cancel the action. Therefore, I want a message box that tells the users that if they click on "OK", the file will be saved in a particular directory, but if they don't want the file getting saved, they should press "CANCEL". I want to create a message box which does the following: If user clicks "OK", the workbook closes. If user clicks "Cancel", the workbook remains open. How can I code this? Thanks, in advance, for your help. -Yasser |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Prompt to Save Message | Excel Discussion (Misc queries) | |||
help with message prompt | New Users to Excel | |||
update prompt message | Excel Programming | |||
Message prompt in VBA | Excel Programming | |||
Deleting a Prompt Message | Excel Programming |