-
message box problem
I have a YesNo message box.
If the user clicks 'Yes', it should proceed to open my exe.
If the user clicks 'No', the message box should close and disappear.
However, regardless of whether the user click Yes or No, it opens my exe. How can I solve this? My code is:
If Check1.Value = true Then
MsgBox "Do you want to proceed?", vbYesNo, "My exe"
End If
Shell ("My exe.exe")
End Sub
Thanks for any help.
-
You need to check the return value of MsgBox. I think it returns either vbYes or vbNo
-
Try this:
Dim Title as String, Msg as String
Dim Reply as Integer, Flags as Integer
Title = "Open .exe ?"
Msg "Do you want to start the app?"
Flags = vbYESNO + vbQUESTION
Reply = MsgBox(Msg, Flags, Title)
If Reply = vbYes Then
Shell ("My exe.exe")
Else
End
End if
Post again if this don't work.....