MsgBox

S

shasta

i tried to a msgbox like i usually do and get a message wen i test i
saying
"Function call on left hand side must return variant or object"

Microsoft Help is no help....i dn't understand wat it means!:confused
 
P

Patrick Molloy

There is no "=" after th emsgbox command
eg

MsgBox = "hello world!"
results in the error that you had.

The code should be

MsgBox "hello world"


Patrick Molloy
Microsoft Excel MVP
 
C

Chip Pearson

It isn't clear what you are trying to do, but try something like

MsgBox "Message",vbOkOnly,"Instructions"
' or
If MsgBox("Message",vbOkCancel,"Instructions") = vbOk Then
' user clicked OK
Else
' user clicked Cancel
End If

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