Consulting

Results 1 to 14 of 14

Thread: Solved: Message box question

  1. #1
    VBAX Contributor
    Joined
    Dec 2004
    Posts
    122
    Location

    Solved: Message box question

    I have the following lines of code.
    [VBA]CreateObject("WScript.Shell").Popup _
    "An employee is not assigned to this row.", 1, "ATTENTION"
    [/VBA]

    The message box that comes up has an "Ok" button. I want the message box to have no buttons. Could anybody help me do that.

    Thank you,

  2. #2
    gsouza...

    Hi

    Maybe the following code works for you...

    [vba]
    CreateObject("WScript.Shell").Popup _
    "An employee is not assigned to this row.", 1, "ATTENTION", 7
    [/vba]
    It's not the nicest msgbox I've ever seen and I don't know if this is the 'proper' way to do it...

    But it works for me!
    < Thanks OBP, for being the first person to help me out on this forum! >

  3. #3
    VBAX Contributor
    Joined
    Dec 2004
    Posts
    122
    Location
    It won't work, now the message box does not pop up at all. Hmmmm

  4. #4
    Well that sucks.

    I didn't mean for that to happen

    I'm using Excel 2000.

    When I tested your code, I created a button and pasted the code that you had. I then adjusted it and it worked (in fact if I type the number 12, the msgbox has a Help/OK/Cancel/Help combination!)

    Maybe you could try some other numbers?

    Hmmmmm.
    < Thanks OBP, for being the first person to help me out on this forum! >

  5. #5
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    ?? Why not use a simple message box? ??

    [VBA]MsgBox "An employee is not assigned to this row.", vbOKOnly, "ATTENTION"[/VBA]

    I fail to see the point of any message box that has no way for the user to get rid of it (e.g. an OK button...)
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  6. #6
    VBAX Contributor
    Joined
    Dec 2004
    Posts
    122
    Location
    I don't know why but I can't get messages to pop up with any ending number and I am also using Excel 2000. Oh well, thank you. And it does suck.

  7. #7
    Maybe you could use a label and use the visible property (false/true) ?

    (OT ... I hope you don't mind, but I'd thought I'd just mention that this is my first reply using a PDA
    < Thanks OBP, for being the first person to help me out on this forum! >

  8. #8
    VBAX Contributor
    Joined
    Dec 2004
    Posts
    122
    Location
    For some reason I can only use numbers from 0 to 6 after that the message box does not pop up. None of the options from 0 to 6 has no buttons. I am going to try the label as you suggested. It is not that important but when things don't work on the same version of Excel from one person's computer and another it makes me wonder why.

  9. #9
    VBAX Contributor
    Joined
    Dec 2004
    Posts
    122
    Location
    Jonske, the message box is a timed message box. It goes away in time. That is why I did not need a button to show.

  10. #10
    Maybe it's an operating system thing.

    Well ... gotta go

    Good luck!
    < Thanks OBP, for being the first person to help me out on this forum! >

  11. #11
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Quote Originally Posted by gsouza
    Jonske, the message box is a timed message box. It goes away in time. That is why I did not need a button to show.
    Make a userform that looks like a message box (you can then use an additional Userform_Click option to unload the form for the impatient user)
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  12. #12
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    example...
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  13. #13
    VBAX Contributor
    Joined
    Dec 2004
    Posts
    122
    Location
    Thanks Johnske, Perfect for what I need and looks good to. Thank you for your help and time, both of you guys, thank you

  14. #14
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Not a prob.
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

Posting Permissions

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