Answering Message boxes
Hello,
You might want to consider this approach:
Dim myAnswer as String
myAnswer = MsgBox "Do you want to Save", vbYesNo
if myAnswer = vbYes then
.... 'do something
else
... ' do something else ...
end if
There are several options you can do with MsgBox.
Hope this helps,
Chad
"isbjornen" wrote:
Hello,
I have a question on how to answer message boxes programmatically.
For example: Answering [No] when closing a file and the message box prompts
me to save.
I've programmed in Lotus before and I used this command:
AnswerMsgBox (Value)
The command had to be entered on the line preceding the message box
AnswerMsgBox No
Application.Quit
In this example the program does not prompt to save before closing.
Is there a similar command in Excel?
Thanx!
|