Log in

View Full Version : VBScript error calling MsgBox



techno_race
09-03-2007, 08:12 PM
Here's the error message:


Line: 1
Char: 1
Error: Invalid procedure call or argument: 'MsgBox'
Code: 800A0005
Source: Microsoft VBScript runtime error

And here's my code:


strMbox = MsgBox("Can't",16,4016,"Error")
If strMbox = 1 Then
strMbox ="."
End If

MsgBox "I said, can't!",4016,"Notification"

WScript.Quit


Now, I can already tell that the problem lies in the second MsgBox, but if I change it to MsgBox("I said, can't!",4016,"Notification"), it says:


Line: 6
Char: 45
Error: Cannot use parentheses when calling a Sub
Code: 800A0414
Source: Microsoft VBScript compilation error


Does anybody know how to resolve this? Google was surprisingly unhelpful.:confused:

jscheuer1
09-05-2007, 05:49 AM
Looks to me that either way, it doesn't like the parenthesise.