Results 1 to 3 of 3

Thread: message box problem

  1. #1

    Thread Starter
    Member
    Join Date
    May 1999
    Posts
    49

    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.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You need to check the return value of MsgBox. I think it returns either vbYes or vbNo
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width