Results 1 to 2 of 2

Thread: VBScript error calling MsgBox

  1. #1
    Join Date
    Feb 2007
    Location
    🌎
    Posts
    528
    Thanks
    10
    Thanked 10 Times in 10 Posts
    Blog Entries
    2

    Angry VBScript error calling MsgBox

    Here's the error message:
    Quote Originally Posted by Windows Script Host
    Line: 1
    Char: 1
    Error: Invalid procedure call or argument: 'MsgBox'
    Code: 800A0005
    Source: Microsoft VBScript runtime error
    And here's my code:
    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:
    Quote Originally Posted by Windows Script Host
    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.
    ....(o_ Penguins
    .---/(o_- techno_racing
    +(---//\-' in
    .+(_)--(_)' The McMurdo 500

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Looks to me that either way, it doesn't like the parenthesise.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •