View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Changing the name of a message box

Remove the parentheses... while they will work if the MsgBox command is
called as a subroutine (rather than if it is called as a function) if only
one argument is specified, using the parentheses with more than one argument
(again, when called as a subroutine) will always generate an error. For
subroutine calls, there are only two reliable methods, either this way...

Command Arg1, Arg2, etc

or this way...

Call Command(Arg1, Arg2, etc)

You can use the parentheses only with the second calling method. So, you
need to do your call either this way....

MsgBox "Fill in this information before continuing.", , "WARNING!"

or this way...

Call MsgBox("Fill in this information before continuing.", , "WARNING!")

Note - You do not need to specify trailing commas if there no additional
optional arguments following them.

--
Rick (MVP - Excel)


"Bishop" wrote in message
...
Apparently I'm not understanding the syntax involved. I totally see what
you're talking about but the help file example isn't very helpful. This
is
what I've tried:
MsgBox ("You have to fill in this information before you can
continue.",,"WARNING!",,)
I've tried every combination with and without , placeholders. I've tried
using no quotes. And I either get a "= expected" error or an "expression"
error.

The syntax required in the helpfile is: MsgBox(prompt[, buttons] [, title]
[, helpfile, context])

So why doesn't this work?


"Patrick Molloy" wrote:

yes

the syntax is

msgbox prompt, buttons, title

VBA intellisence gives you the full list, but basically, whatever you use
as
"title" will appear as the heading



"Bishop" wrote:

Can I change the name of a messege box to something other than
Microsoft Excel?