TechnologyUK - Programming (VB6) Logo

Error Codes

Visual Basic's Err object returns the number associated with the current error condition in its Number property (Err.Number). The Error() function takes this error number as its argument, and returns a string containing a description of the error. The Visual Basic error codes are listed below.


Visual Basic Error Codes
CodeDescription
3Return without GoSub.
5Invalid procedure call or argument.
6Overflow.
7Out of memory.
8Application-defined or object-defined error.
9Subscript out of range.
10This array is fixed or temporarily locked.
11Division by zero.
13Type mismatch.
14Out of string space.
16Expression too complex.
17Can't perform requested operation.
18User interrupt occurred.
20Resume without error.
28Out of stack space.
35Sub or Function not defined.
47Too many DLL application clients.
48Error in loading DLL.
49Bad DLL calling convention.
51Internal error.
52Bad file name or number.
53File not found.
54Bad file mode.
55File already open.
57Device I/O error.
58File already exists.
59Bad record length.
61Disk full.
62Input past end of file.
63Bad Record number.
67Too many files.
68Device unavailable.
70Permission denied.
71Disk not ready.
74Can't rename with different drive.
75Path/File access error.
76Path not found.
91Object variable or With block variable not set.
92For loop not initialized.
93Invalid pattern string.
94Invalid use of Null.
96Unable to sink events of object because the object
is already firing events to the maximum number of
event receivers that it supports.
97Cannot call friend function on object, which is not an
instance of defining class.
98A property or method call cannot include a reference
to a private object, either as an argument or as a
return value.
321Invalid file format.
322Can't create necessary temporary file.
325Invalid format in resource file.
380Invalid property value.
381Invalid property array index.
382Set not supported at runtime.
383Set not supported (read-only property).
385Need property array index.
387Set not permitted.
393Get not supported at runtime.
394Get not supported (write-only property).