Beruflich Dokumente
Kultur Dokumente
More Information
Microsoft provides programming examples for illustration only, without
warranty either expressed or implied. This includes, but is not limited to,
the implied warranties of merchantability or fitness for a particular
purpose. This article assumes that you are familiar with the
programming language that is being demonstrated and with the tools
that are used to create and to debug procedures. Microsoft support
engineers can help explain the functionality of a particular procedure,
but they will not modify these examples to provide added functionality
or construct procedures to meet your specific requirements.
This error may also occur if an attempt is made to call a procedure that
is not valid on the current platform. For example, some procedures may
only be valid for the Macintosh, or for Microsoft Windows, and so forth.
Overflow (Error 6)
This error usually occurs only when generated from code, as in the
following example:
Error 10
However the error may also occur if you try to use ReDim to change the
number of elements of a fixed-size array. For example, in the following
code, the fixed array FixedArr is received by SomeArr in the procedure
NextOne, then an attempt is made to resize SomeArr:
Sub FirstOne
Static FixedArr(25) As Integer ' Create a fixed-
size array
NextOne FixedArr() ' and pass it to
another sub.
End Sub
Error CVErr(n)
A CVErr value can't be converted to Date or numeric types
(Integer, Long, and so on); for example:
MyVar = CInt(CVErr(9))
At run time, this error typically indicates that a Variant used in an
expression has an incorrect subtype, or that a Variant containing
an array appeared in a Print statement.
Your system may have run out of memory, which has prevented a string
from being allocated. Similarly, expressions requiring that temporary
strings be created for evaluation may be causing this error. For
example, the following code will cause an Out of string space error:
MyString = "Hello"
For Count = 1 To 100
MyString = MyString & MyString
Next Count
Visual Basic lets you allocate a string with a maximum length of 65,535
characters. However, in executing statements at run time, the host
application needs to use some string space for overhead. The amount
of overhead varies among hosts, but should not exceed 50 bytes. If you
need to allocate a string of the maximum length your host can support,
reduce the string size by 50 bytes, then increase the length
incrementally until this error is generated again. The value immediately
preceding the error represents the host's maximum string length.
Sub MySub
MyString = "string" ' Error occurs here when
the
End Sub ' maximum length is
exceeded.
Use the Calls dialog box to view which procedures are active (on the
stack). To display the Calls dialog box, select the button to the right of
the Procedures box in the Debug window.
A statement refers to a file with a file number or file name that is:
The name of a file or directory can have two parts: a name and an
optional extension. The two parts are separated by a period, for
example, Myfile.new.
The name must start with either a letter or number. It can contain
any uppercase or lowercase (file names are not case-sensitive)
characters except the following:
Character Description
----------------------------------
. Period
" Quotation mark
' Single quotation mark
(apostrophe)
+ Plus sign
/ Slash
\ Backslash
[ ] Brackets
: Colon
; Semicolon
| Vertical bar (pipe)
= Equal sign
, Comma
The name should not contain any spaces. The following names
are reserved and can't be used for files or directories: CON, AUX,
COM1, COM2, COM3, COM4, LPT1, LPT2, LPT3, PRN, and NUL.
For instance, if you try to name a file PRN in an Open statement,
the default printer will simply become the destination for Print #,
and Write # statements directed to the file number specified in the
Open statement.
On the Macintosh, a file can have any character except the colon
(:), and may contain spaces. Null characters [Chr(0)] are not
allowed in any file names.
File not found (Error 53)
At run time, this error occurs when the new file name (for example, one
specified in a Name statement) is identical to a file name that already
exists. It also occurs when you use Save As to save a currently loaded
project if the project name already exists.
The length of a record variable for a Get or Put statement does not
match the length specified in the corresponding Open statement.
Because a two- byte descriptor is always added to a variable-length
string Put to a random access file, the variable-length string must be at
least two characters shorter than the record length specified in the Len
clause of the Open statement.
There is not enough room on the disk for the completion of a Print
#, Write #, or Close operation.
To work around this situation, move some files to another disk, or delete
some files.
There is a limit to the number of disk files that can be open at one
time. For Microsoft Windows, this limit is a function of the Files=
setting in your CONFIG.SYS file. Increase that number and reboot.
The operating system has a limit to the number of files in the root
directory (usually 512). If your program is opening, closing, or
saving files in the root directory, change your program so that it
uses a subdirectory.
The device you are trying to access is either not online or does not
exist.
There is either no disk in the drive specified or the drive door is open.
Insert a disk in the drive, close the door, and retry the operation.
You can't use the Name statement to rename a file with a new drive
designation. Use FileCopy to write the file to another drive, and delete
the old file with a Kill statement.
Make sure the file specification is formatted correctly. A file name can
contain a fully-qualified or relative path. A fully-qualified path starts with
the drive name (if the path is on another drive) and lists the explicit path
from the root to the file. Any path that is not fully qualified is relative to
the current drive and directory. This error can also occur while
attempting to save a file that would replace an existing read-only file.
You are attempting to use an object variable that is not yet referencing a
valid object, or one that has been set to Nothing. Specify or respecify a
reference for the object variable. For example, if the Set statement were
omitted in the following code, an error would be generated:
You've jumped into the middle of a For...Next loop. Placing labels inside
a For...Next loop is not recommended.
MyVar = Null
For Count = 1 To MyVar
. . .
Next Count
The module you attempted to load is not a text module. Some versions
of Visual Basic permit you to save code in both binary and text formats.
If possible, reload the file in the application in which it was last saved
and save it as text. This error code applies to Microsoft Excel for
Windows 95, version 7.0 only.
This method or property does not exist for this OLE automation object.
See the object's documentation for more information on the object and
to check the spellings of properties and methods.
The object you are attempting to access does not support the locale
setting for the current project. For example, if your current project has
the locale setting Canadian French, the object you are trying to access
must support that locale setting. Check which locale settings the object
supports.
Also note that the object may rely on national language support in a
dynaminc-link library (DLL), for example OLE2NLS.DLL. If so, you may
need a more recent version that supports the current project locale.
The number and types of arguments must match those expected. For
instance, the Left function requires two arguments, the first
representing the character string being operated on, and the second
representing the number of characters to return from the left side of the
string. Because neither argument is optional, both must be supplied.
The number of arguments in the call to the procedure was not the same
as the number of arguments expected by the procedure. Check the
argument list in the call against the procedure declaration.
The dynamic-link library (DLL) in a user library reference was found, but
the DLL function specified was not found within the DLL. An invalid
ordinal may have been specified in the function declaration. Also, the
DLL may have the right name but is not the version that contains the
specified function.
The property does not exist for this object. To see a list of properties for
this object, choose Object Browser from the View menu, and click the
question mark button in the Object Browser dialog box to display the
Visual Basic Help topic for this object.
The method does not exist for this object. To see a list of methods for
this object, choose Object Browser from the View menu, and click the
question mark button in the Object Browser dialog box to display the
Visual Basic Help topic for this object.
The method expected a required argument that does not exist. Add the
argument to the code. To see a list of required arguments, choose
Object Browser from the View menu, and click the question mark
button in the Object Browser dialog box to display the Visual Basic
Help topic.
The method has the wrong number of arguments. This usually occurs
when you use comma-separated position arguments (instead of named
arguments), and you have too many arguments.
To see the valid arguments for this method, choose Object Browser
from the View menu, and click the question mark button in the Object
Browser dialog box to display the Visual Basic Help topic for this
method.
For more information about the method, search Help for the method
name.
The value you're using for the property isn't valid (for example,
you set a property to a string value, but the property requires a
Boolean value).
The value you are using for the property is not valid; for example,
setting a property to a string value when the property requires a
Boolean value.