List of VBScript errors
Here is a list of all VBScript errors relating to built-in functions and tips to fix them. Objects can raise other error messages not mentioned here.
Contents
- 1 Parsing errors
- 1.1 Error 1001
- 1.2 Error 1002
- 1.3 Error 1003
- 1.4 Error 1005
- 1.5 Error 1006
- 1.6 Error 1007
- 1.7 Error 1010
- 1.8 Error 1011
- 1.9 Error 1012
- 1.10 Error 1013
- 1.11 Error 1014
- 1.12 Error 1015
- 1.13 Error 1016
- 1.14 Error 1017
- 1.15 Error 1018
- 1.16 Error 1019
- 1.17 Error 1020
- 1.18 Error 1021
- 1.19 Error 1022
- 1.20 Error 1023
- 1.21 Error 1024
- 1.22 Error 1025
- 1.23 Error 1026
- 1.24 Error 1027
- 1.25 Error 1028
- 1.26 Error 1029
- 1.27 Error 1030
- 1.28 Error 1031
- 1.29 Error 1032
- 1.30 Error 1033
- 1.31 Error 1034
- 1.32 Error 1037
- 1.33 Error 1038
- 1.34 Error 1039
- 1.35 Error 1040
- 1.36 Error 1041
- 1.37 Error 1042
- 1.38 Error 1043
- 1.39 Error 1044
- 1.40 Error 1045
- 1.41 Error 1046
- 1.42 Error 1047
- 1.43 Error 1048
- 1.44 Error 1049
- 1.45 Error 1050
- 1.46 Error 1051
- 1.47 Error 1052
- 1.48 Error 1053
- 1.49 Error 1054
- 1.50 Error 1055
- 1.51 Error 1056
- 1.52 Error 1057
- 1.53 Error 1058
- 2 Run-time errors
- 2.1 Error 5
- 2.2 Error 6
- 2.3 Error 7
- 2.4 Error 9
- 2.5 Error 10
- 2.6 Error 11
- 2.7 Error 13
- 2.8 Error 14
- 2.9 Error 17
- 2.10 Error 28
- 2.11 Error 35
- 2.12 Error 48
- 2.13 Error 51
- 2.14 Error 52
- 2.15 Error 53
- 2.16 Error 54
- 2.17 Error 55
- 2.18 Error 57
- 2.19 Error 58
- 2.20 Error 61
- 2.21 Error 62
- 2.22 Error 67
- 2.23 Error 68
- 2.24 Error 70
- 2.25 Error 71
- 2.26 Error 74
- 2.27 Error 75
- 2.28 Error 76
- 2.29 Error 91
- 2.30 Error 92
- 2.31 Error 94
- 2.32 Error 322
- 2.33 Error 424
- 2.34 Error 429
- 2.35 Error 430
- 2.36 Error 432
- 2.37 Error 438
- 2.38 Error 440
- 2.39 Error 445
- 2.40 Error 447
- 2.41 Error 448
- 2.42 Error 449
- 2.43 Error 450
- 2.44 Error 451
- 2.45 Error 453
- 2.46 Error 455
- 2.47 Error 457
- 2.48 Error 458
- 2.49 Error 462
- 2.50 Error 481
- 2.51 Error 500
- 2.52 Error 501
- 2.53 Error 502
- 2.54 Error 503
- 2.55 Error 504
- 2.56 Error 505
- 2.57 Error 506
- 2.58 Error 507
- 2.59 Error 4096
- 2.60 Error 4097
- 2.61 Error 5016
- 2.62 Error 5017
- 2.63 Error 5018
- 2.64 Error 5019
- 2.65 Error 5020
- 2.66 Error 5021
- 2.67 Error 30000
- 2.68 Error 32766
- 2.69 Error 32767
- 2.70 Error 32768
- 2.71 Error 32769
- 2.72 Error 32770
- 2.73 Error 32811
- 2.74 Error 32811
- 3 See also
Parsing errors
These are the possible parsing errors that can occur.
Error 1001
Description: Out of Memory
Error 1002
Description: Syntax error
Error 1003
Description: Expected ':'
Error 1005
Description: Expected '('
You are missing parentheses around the parameters of a property, function, or subroutine, or around the upper bound value in a ReDim
statement.
Error 1006
Description: Expected ')'
You are missing the closing parentheses for some line of code.
Error 1007
Description: Expected ']'
You are missing the closing square bracket for some bracketted identifier.
Error 1010
Description: Expected identifier
Error 1011
Description: Expected '='
You forgot the =
operator in a Set
assignment statement. The format is Set
variable =
object expression.
Error 1012
Description: Expected 'If'
Error 1013
Description: Expected 'To'
Error 1014
Description: Expected 'End'
Error 1015
Description: Expected 'Function'
Error 1016
Description: Expected 'Sub'
Error 1017
Description: Expected 'Then'
Error 1018
Description: Expected 'Wend'
Error 1019
Description: Expected 'Loop'
Error 1020
Description: Expected 'Next'
Error 1021
Description: Expected 'Case'
You have a Select
block with a missing Case
keyword after the Select
keyword. The format is Select Case
expression.
Error 1022
Description: Expected 'Select'
Error 1023
Description: Expected expression
Error 1024
Description: Expected statement
Error 1025
Description: Expected end of statement
Error 1026
Description: Expected integer constant
Error 1027
Description: Expected 'While' or 'Until'
Error 1028
Description: Expected 'While,' 'Until,' or end of statement
Error 1029
Description: Expected 'With'
Error 1030
Description: Identifier too long
Error 1031
Description: Invalid number
Error 1032
Description: Invalid character
Error 1033
Description: Unterminated string constant
Error 1034
Description: Unterminated comment
Error 1037
Description: Invalid use of 'Me' keyword
Error 1038
Description: 'loop' without 'do'
Error 1039
Description: Invalid 'exit' statement
Error 1040
Description: Invalid 'for' loop control variable
Error 1041
Description: Name redefined
Error 1042
Description: Must be first statement on the line
Error 1043
Description: Cannot assign to non-ByVal argument
Error 1044
Description: Cannot use parentheses when calling a Sub
To call a subroutine, you have two methods: one without the parentheses around the arguments, and one with them (requires the Call
keyword).
Error 1045
Description: Expected literal constant
Error 1046
Description: Expected 'In'
Error 1047
Description: Expected 'Class'
Error 1048
Description: Must be defined inside a Class
Error 1049
Description: Expected Let or Set or Get in property declaration
Error 1050
Description: Expected 'Property'
Error 1051
Description: Number of arguments must be consistent across properties specification
Error 1052
Description: Cannot have multiple default property/method in a Class
You defined multiple properties and/or methods as Default
in this class. There can only be one.
Error 1053
Description: Class initialize or terminate do not have arguments
The two class events cannot have arguments. Remove them. To pass a value to an object on creation, you have to call another function.
I recommend making a separate function called "Init" and passing the initializing arguments to that. ~Ribose
Error 1054
Description: Property Set or Let must have at least one argument
Error 1055
Description: Unexpected 'Next'
Error 1056
Description: 'Default' can be specified only on 'Property' or 'Function' or 'Sub'
Error 1057
Description: 'Default' specification must also specify 'Public'
Default
members must be publicly accessible. Change Private Default
to Public Default
.
Error 1058
Description: 'Default' specification can only be on Property Get
You defined a Property Let
or Property Set
as default. Default
properties are a value you get.
Run-time errors
These are the possible run-time errors that can occur by default. Some objects used in scripting may raise custom run-time errors when something goes wrong involving them.
Error 5
Description: Invalid procedure call or argument
Error 6
Description: Overflow
Error 7
Description: Out of Memory
Error 9
Description: Subscript out of range
Error 10
Description: This array is fixed or temporarily locked
Error 11
Description: Division by zero
This occurs when the right operand of a division operation is equal to zero. Check variables or functions being passed to the right of division.
Error 13
Description: Type mismatch
This occurs when two types cannot be compared with the specified operation, or a subroutine was called that could not be found. For example, check to make sure values of type integer (not string) are being compared in >
and <
operations.
Error 14
Description: Out of string space
Error 17
Description: Can't perform requested operation
Error 28
Description: Out of stack space
Error 35
Description: Sub or function not defined
Error 48
Description: Error in loading DLL
Error 51
Description: Internal error
Error 52
Description: Bad file name or number
Error 53
Description: File not found
Error 54
Description: Bad file mode
Error 55
Description: File already open
Error 57
Description: Device I/O error
Error 58
Description: File already exists
Error 61
Description: Disk full
Error 62
Description: Input past end of file
Error 67
Description: Too many files
Error 68
Description: Device unavailable
Error 70
Description: Permission denied
Error 71
Description: Disk not ready
Error 74
Description: Can't rename with different drive
Error 75
Description: Path/File access error
Error 76
Description: Path not found
Error 91
Description: Object variable not set
Error 92
Description: For loop not initialized
Error 94
Description: Invalid use of Null
Error 322
Description: Can't create necessary temporary file
Error 424
Description: Object required
Error 429
Description: ActiveX component can't create object
Error 430
Description: Class doesn't support Automation
Error 432
Description: File name or class name not found during Automation operation
Error 438
Description: Object doesn't support this property or method
Error 440
Description: Automation error
Error 445
Description: Object doesn't support this action
Error 447
Description: Object doesn't support current locale setting
Error 448
Description: Named argument not found
Error 449
Description: Argument not optional
Error 450
Description: Wrong number of arguments or invalid property assignment
Error 451
Description: Object not a collection
Error 453
Description: Specified DLL function not found
Error 455
Description: Code resource lock error
Error 457
Description: This key is already associated with an element of this collection
Error 458
Description: Variable uses an Automation type not supported in VBScript
Error 462
Description: The remote server machine does not exist or is unavailable
Error 481
Description: Invalid picture
Error 500
Description: Variable is undefined
Error 501
Description: Illegal assignment
Error 502
Description: Object not safe for scripting
Error 503
Description: Object not safe for initializing
Error 504
Description: Object not safe for creating
Error 505
Description: Invalid or unqualified reference
Error 506
Description: Class not defined
Error 507
Description: An exception occurred
Error 4096
Description: Microsoft VBScript compilation error
Error 4097
Description: Microsoft VBScript runtime error
Error 5016
Description: Regular Expression object expected
Error 5017
Description: Syntax error in regular expression
Error 5018
Description: Unexpected quantifier
Error 5019
Description: Expected ']' in regular expression
Error 5020
Description: Expected ')' in regular expression
Error 5021
Description: Invalid range in character set
Error 30000
Description: EN
Error 32766
Description: True
Error 32767
Description: False
Error 32768
Description: OK
Error 32769
Description: Cancel
Error 32770
Description: Help
Error 32811
Description: Element not found
Error 32811
Description: The specified date is not available in the current locale's calendar