Michael D. Edwards
Software Design Engineer
Microsoft Corporation
March 11, 1999
This is the complete list of syntax and run-time errors produced by the JScript and VBScript version 5.0 script engines. This page accompanies "Handling and Avoiding Web Page Errors Part 2: Run-time Errors," specifically the section of that article entitled "The Definitive Script Error Listing," where I talk about how to interpret script error codes and other goodies.
You can download the JScript and VBScript version 5.0 script engines from the Microsoft Scripting Technologies Web site.
The JScript Error Messages and VBScript Error Messages documented in the above Scripting site both combine syntax and run-time errors; here they are listed separately. The tables below are more complete because additional error messages are added to the script engines with every release.
The JScript and VBScript script engines share many common error types. Thus, they share the same error number for equivalent sources of an error. Accordingly, identical error numbers in the JScript and VBScript tables refer to the same error (though their actual description may vary slightly).
These lists do not include errors that originate from an external component that is referenced in a script statement, since those errors are merely passed along to the caller. For example, errors produced by Active Data Objects (ADO) on your Web page are not listed here. You can find error listings for external components in the individual component's documentation.
Finally, as it turns out, the JScript and VBScript script engines convert some common, external component errors into an internal script engine error. For example, the COM error resulting from a script statement with a mistyped method name is converted into an internal script error. That’s cool because you don’t have to track down the more generic errors any further than the script error tables published here.
Number | Description |
5 | "Invalid procedure call or argument" |
6 | "Overflow" |
7 | "Out of memory" |
9 | "Subscript out of range" |
10 | "This array is fixed or temporarily locked" |
11 | "Division by zero" |
13 | "Type mismatch" |
14 | "Out of string space" |
17 | "Can't perform requested operation" |
28 | "Out of stack space" |
35 | "Sub or Function not defined" |
48 | "Error in loading DLL" |
51 | "Internal error" |
52 | "Bad file name or number" |
53 | "File not found" |
54 | "Bad file mode" |
55 | "File already open" |
57 | "Device I/O error" |
58 | "File already exists" |
61 | "Disk full" |
62 | "Input past end of file" |
67 | "Too many files" |
68 | "Device unavailable" |
70 | "Permission denied" |
71 | "Disk not ready" |
74 | "Can't rename with different drive" |
75 | "Path/File access error" |
76 | "Path not found" |
91 | "Object variable or With block variable not set" |
92 | "For loop not initialized" |
94 | "Invalid use of Null" |
322 | "Can't create necessary temporary file" |
424 | "Object required" |
429 | "Automation server can't create object" |
430 | "Class doesn't support Automation" |
432 | "File name or class name not found during Automation operation" |
438 | "Object doesn't support this property or method" |
440 | "Automation error" |
445 | "Object doesn't support this action" |
446 | "Object doesn't support named arguments" |
447 | "Object doesn't support current locale setting" |
448 | "Named argument not found" |
449 | "Argument not optional" |
450 | "Wrong number of arguments or invalid property assignment" |
451 | "Object not a collection" |
453 | "Specified DLL function not found" |
458 | "Variable uses an Automation type not supported in JScript" |
462 | "The remote server machine does not exist or is unavailable" |
501 | "Cannot assign to variable" |
502 | "Object not safe for scripting" |
503 | "Object not safe for initializing" |
504 | "Object not safe for creating" |
5000 | "Cannot assign to 'this'" |
5001 | "Number expected" |
5002 | "Function expected" |
5003 | "Cannot assign to a function result" |
5004 | "Cannot index object" |
5005 | "String expected" |
5006 | "Date object expected" |
5007 | "Object expected" |
5008 | "Illegal assignment" |
5009 | "Undefined identifier" |
5010 | "Boolean expected" |
5011 | "Can't execute code from a freed script" |
5012 | "Object member expected" |
5013 | "VBArray expected" |
5014 | "JScript object expected" |
5015 | "Enumerator object expected" |
5016 | "Regular Expression object expected" |
5017 | "Syntax error in regular expression" |
5018 | "Unexpected quantifier" |
5019 | "Expected ']' in regular expression" |
5020 | "Expected ')' in regular expression" |
5021 | "Invalid range in character set" |
5022 | "Exception thrown and not caught" |
5023 | "Function does not have a valid prototype object" |
Number | Description |
5 | "Invalid procedure call or argument" |
6 | "Overflow" |
7 | "Out of memory" |
9 | "Subscript out of range" |
10 | "This array is fixed or temporarily locked" |
11 | "Division by zero" |
13 | "Type mismatch" |
14 | "Out of string space" |
17 | "Can't perform requested operation" |
28 | "Out of stack space" |
35 | "Sub or Function not defined" |
48 | "Error in loading DLL" |
51 | "Internal error" |
52 | "Bad file name or number" |
53 | "File not found" |
54 | "Bad file mode" |
55 | "File already open" |
57 | "Device I/O error" |
58 | "File already exists" |
61 | "Disk full" |
62 | "Input past end of file" |
67 | "Too many files" |
68 | "Device unavailable" |
70 | "Permission denied" |
71 | "Disk not ready" |
74 | "Can't rename with different drive" |
75 | "Path/File access error" |
76 | "Path not found" |
91 | "Object variable not set" |
92 | "For loop not initialized" |
94 | "Invalid use of Null" |
322 | "Can't create necessary temporary file" |
424 | "Object required" |
429 | "ActiveX component can't create object" |
430 | "Class doesn't support Automation" |
432 | "File name or class name not found during Automation operation" |
438 | "Object doesn't support this property or method" |
440 | "Automation error" |
445 | "Object doesn't support this action" |
446 | "Object doesn't support named arguments" |
447 | "Object doesn't support current locale setting" |
448 | "Named argument not found" |
449 | "Argument not optional" |
450 | "Wrong number of arguments or invalid property assignment" |
451 | "Object not a collection" |
453 | "Specified DLL function not found" |
455 | "Code resource lock error" |
457 | "This key is already associated with an element of this collection" |
458 | "Variable uses an Automation type not supported in VBScript" |
462 | "The remote server machine does not exist or is unavailable" |
481 | "Invalid picture" |
500 | "Variable is undefined" |
501 | "Illegal assignment" |
502 | "Object not safe for scripting" |
503 | "Object not safe for initializing" |
504 | "Object not safe for creating" |
505 | "Invalid or unqualified reference" |
506 | "Class not defined" |
5016 | "Regular Expression object expected" |
5017 | "Syntax error in regular expression" |
5018 | "Unexpected quantifier" |
5019 | "Expected ']' in regular expression" |
5020 | "Expected ')' in regular expression" |
5021 | "Invalid range in character set" |
32811 | "Element not found" |
Number | Description |
1001 | "Out of memory" |
1002 | "Syntax error" |
1003 | "Expected ':'" |
1004 | "Expected ';'" |
1005 | "Expected '('" |
1006 | "Expected ')'" |
1007 | "Expected ']'" |
1008 | "Expected '{'" |
1009 | "Expected '}'" |
1010 | "Expected identifier" |
1011 | "Expected '='" |
1012 | "Expected '/'" |
1013 | "Invalid number" |
1014 | "Invalid character" |
1015 | "Unterminated string constant" |
1016 | "Unterminated comment" |
1018 | "'return' statement outside of function" |
1019 | "Can't have 'break' outside of loop" |
1020 | "Can't have 'continue' outside of loop" |
1023 | "Expected hexadecimal digit" |
1024 | "Expected 'while'" |
1025 | "Label redefined" |
1026 | "Label not found" |
1027 | "'default' can only appear once in a 'switch' statement" |
1028 | "Expected identifier or string" |
1029 | "Expected '@end'" |
1030 | "Conditional compilation is turned off" |
1031 | "Expected constant" |
1032 | "Expected '@'" |
1033 | "Expected 'catch'" |
1034 | "Expected 'var'" |
1035 | "throw must be followed by an expression on the same source line" |
Number | Description |
1001 | "Out of memory" |
1002 | "Syntax error" |
1003 | "Expected ':'" |
1005 | "Expected '('" |
1006 | "Expected ')'" |
1007 | "Expected ']'" |
1010 | "Expected identifier" |
1011 | "Expected '='" |
1012 | "Expected 'If'" |
1013 | "Expected 'To'" |
1014 | "Expected 'End'" |
1015 | "Expected 'Function'" |
1016 | "Expected 'Sub'" |
1017 | "Expected 'Then'" |
1018 | "Expected 'Wend'" |
1019 | "Expected 'Loop'" |
1020 | "Expected 'Next'" |
1021 | "Expected 'Case'" |
1022 | "Expected 'Select'" |
1023 | "Expected expression" |
1024 | "Expected statement" |
1025 | "Expected end of statement" |
1026 | "Expected integer constant" |
1027 | "Expected 'While' or 'Until'" |
1028 | "Expected 'While', 'Until' or end of statement" |
1029 | "Expected 'With'" |
1030 | "Identifier too long" |
1031 | "Invalid number" |
1032 | "Invalid character" |
1033 | "Unterminated string constant" |
1034 | "Unterminated comment" |
1037 | "Invalid use of 'Me' keyword" |
1038 | "'loop' without 'do'" |
1039 | "Invalid 'exit' statement" |
1040 | "Invalid 'for' loop control variable" |
1041 | "Name redefined" |
1042 | "Must be first statement on the line" |
1043 | "Cannot assign to non-ByVal argument" |
1044 | "Cannot use parentheses when calling a Sub" |
1045 | "Expected literal constant" |
1046 | "Expected 'In'" |
1047 | "Expected 'Class'" |
1048 | "Must be defined inside a Class" |
1049 | "Expected Let or Set or Get in property declaration" |
1050 | "Expected 'Property'" |
1051 | "Number of arguments must be consistent across properties specification" |
1052 | "Cannot have multiple default property/method in a Class" |
1053 | "Class initialize or terminate do not have arguments" |
1054 | "Property set or let must have at least one argument" |
1055 | "Unexpected 'Next'" |
1056 | "'Default' can be specified only on 'Property' or 'Function' or 'Sub'" |
1057 | "'Default' specification must also specify 'Public'") |
1058 | "'Default' specification can only be on Property Get" |