msgbox buttons

J

jmikerea

Can anyone tell me why in Excel 2000 I can only produce a msgbox with a vbokonly button. In j-walks book Excel 2002 Power Programming with VBA, chapter 8 pg 200 it says that I should be able to have various arrangements of buttons
 
X

xld

Don't know why you can't, but MsgBox supports all sorts of buttons as
its buttons arguement
vbOKOnly 0 Display OK button only.
VbOKCancel 1 Display OK and Cancel buttons.
VbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons.
VbYesNoCancel 3 Display Yes, No, and Cancel buttons.
VbYesNo 4 Display Yes and No buttons.
VbRetryCancel

You can also set other flags, such as vbcritical. See the help for
details.
 
F

Frank Kabel

Hi
just define the second parameter of msgbox accordingly.
e.g.
msgbox("test",vbAbortRetryIgnore)
-----Original Message-----
Can anyone tell me why in Excel 2000 I can only produce a
msgbox with a vbokonly button. In j-walks book Excel 2002
Power Programming with VBA, chapter 8 pg 200 it says that
I should be able to have various arrangements of buttons
 
C

Chip Pearson

What code are you using? The buttons and their captions are
determined by the second argument to the MsgBox function. If you
omit this second argument, the default is vbOKOnly. Try, for
example, code like

MsgBox "Click", vbOKCancel
MsgBox "Click", vbYesNo
MsgBox "Click", vbRetryCancel

See the on line help for MsgBox for more details about the
constants you can provide to control the buttons.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




jmikerea said:
Can anyone tell me why in Excel 2000 I can only produce a
msgbox with a vbokonly button. In j-walks book Excel 2002 Power
Programming with VBA, chapter 8 pg 200 it says that I should be
able to have various arrangements of buttons
 
Top