Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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
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
Prompt to Save Message Adam O Excel Discussion (Misc queries) 2 December 10th 08 08:22 PM
help with message prompt Monty New Users to Excel 1 September 9th 05 10:03 AM
update prompt message Souris Excel Programming 1 August 23rd 05 05:41 AM
Message prompt in VBA ltong Excel Programming 4 October 6th 04 05:16 PM
Deleting a Prompt Message LC[_2_] Excel Programming 2 July 18th 03 09:46 PM


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