Code Error 800A0400 - Expected Statement
Troubleshooting Code 800A0400 - Expected Statement
Perhaps instead of 'Expected Statement', 'missing character' would be a better error message. I have noticed with error 800A0400 how often the problem is at the beginning or the end of the line mentioned in the error message.
Introduction to Code 800A0400
Error code 800A0400 is a generic message when you execute a VBScript. A wild guess, you have missed a command at the beginning of a line.
The Symptoms You Get
The script does not execute as you had hoped. Instead you get a message box like this picture:
The Cause of Error 800A0400
Your VBScript contain is missing a statement. This is a difficult error to track down. However, the good news is that I have three examples. Most likely you have placed a statement, which is not appropriate for the logic of your script. For example, extra brackets, or missing command.
Note: the clue 'Source: Microsoft VBScript compilation error'. My point is that 'compilation error' and not a 'runtime error', means this is a syntax error in your script.
The Solution for Error: Expected statement
The Windows Scripting Host gives us two useful clues, firstly, look on Line: 10, do count any remark or empty lines. Secondly, the Char: number 1, is useful in tracing the error. In this case there is something wrong with the Select statement.
The line number, as is so often the case, is crucial to solving this error. The problem is that the whole line is gibberish to the VBScript engine. So take another look at each word, punctuation and see if you can spot a simple error.
Example 1 of Error code: 800A0400
Missing underscore at the end of the line 7:
Missing underscore at the end of the line:
WScript.Echo "WSH Version: " & WScript.Version & " " & _
SolarWinds' Orion performance monitor will help you discover what's happening on your network. This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.
What I like best is the way NPM suggests solutions to network problems. Its also has the ability to monitor the health of individual VMware virtual machines. If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.
Example 2 of 800A0400
Error on Line 4.
Talk about stupid errors, there is no ' apostrophe to Rem out that line of dashes.
is below, and the pclist.txt contain only 2 line:
Example 3 of 800A0400 (Code available)
I just plain missed command, for example no 'Set'.
"Error" ObjNetwork = CreateObject("Wscript.Network")
Set ObjNetwork = CreateObject("Wscript.Network")
This Engineer's Toolset v10 provides a comprehensive console of 50 utilities for troubleshooting computer problems. Guy says it helps me monitor what's occurring on the network, and each tool teaches me more about how the underlying system operates.
There are so many good gadgets; it's like having free rein of a sweetshop. Thankfully the utilities are displayed logically: monitoring, network discovery, diagnostic, and Cisco tools. Try the SolarWinds Engineer's Toolset now!
Example 4 - No need for End If
The 800A0400 error message in VBScript often appears when the user adds a "End" statement when there is no need for one. For example, in this script, the user puts "End If", when there is no If statement to end.
MsgBox "Click OK to continue"
There was no need for the user to put "End If", so the script host says that the user needs to put an 'If' statement, but wouldn't it make much more sense if it told the user to delete the 'End If' statement?
This example was kindly sent in by Alex Jones.
n_Num = 3
Kindly sent in by Bradley Harris.
See More Windows Update Error Codes 8004 Series
If you like this page then please share it with your friends