PDA

View Full Version : Solved: Message box question



gsouza
05-05-2006, 04:50 AM
I have the following lines of code.
CreateObject("WScript.Shell").Popup _
"An employee is not assigned to this row.", 1, "ATTENTION"


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,

Sir Newbie
05-05-2006, 05:34 AM
gsouza...

Hi :)

Maybe the following code works for you...


CreateObject("WScript.Shell").Popup _
"An employee is not assigned to this row.", 1, "ATTENTION", 7

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!

gsouza
05-05-2006, 05:43 AM
It won't work, now the message box does not pop up at all. Hmmmm:dunno

Sir Newbie
05-05-2006, 05:56 AM
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.

johnske
05-05-2006, 06:07 AM
?? Why not use a simple message box? ??

MsgBox "An employee is not assigned to this row.", vbOKOnly, "ATTENTION"

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...)

gsouza
05-05-2006, 06:17 AM
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.

Sir Newbie
05-05-2006, 06:45 AM
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 :)

gsouza
05-05-2006, 07:08 AM
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.

gsouza
05-05-2006, 07:11 AM
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.

Sir Newbie
05-05-2006, 07:26 AM
Maybe it's an operating system thing.

Well ... gotta go :)

Good luck!

johnske
05-05-2006, 07:36 AM
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)

johnske
05-05-2006, 08:00 AM
example...

gsouza
05-05-2006, 08:11 AM
Thanks Johnske, Perfect for what I need and looks good to. Thank you for your help and time, both of you guys, thank you

johnske
05-05-2006, 08:30 AM
Not a prob. :)