Overflow

C

Craig

It is really important that I find out why an error
message pops up that simply says: Overflow.

I have tried to look in the help section for this, but I
cannot find anything about it.

Under what circumstances will it pop up? How can it be
fixed? What does it mean? Why does the error not
explained?

If anyone can answer these questions, please e-mail me at
(e-mail address removed)

Thank you for your help!!!
 
D

Dev Ashish

I have tried to look in the help section for this, but I
cannot find anything about it.

I clicked 'Help' on the actual error messagebox and this is what I got
from help. (First the routine)

Sub Test
Dim i as integer
i = 60000
End Sub

Overflow (Error 6)

An overflow results when you try to make an assignment that exceeds the
limitations of the target of the assignment. This error has the following
causes and solutions:

The result of an assignment, calculation, or data type conversion is too
large to be represented within the range of values allowed for that type
of variable.
Assign the value to a variable of a type that can hold a larger range of
values.

An assignment to a property exceeds the maximum value the property can
accept.
Make sure your assignment fits the range for the property to which it is
made.

You attempt to use a number in a calculation, and that number is coerced
into an integer, but the result is larger than an integer. For example:
Dim x As Long
x = 2000 * 365 ' Error: Overflow
To work around this situation, type the number, like this:

Dim x As Long
x = CLng(2000) * 365
For additional information, select the item in question and press F1 (in
Windows) or HELP (on the Macintosh).


-- Dev
 
G

Guest

An overflow usually refers to something that has
gotten "too big". If you are using a veriable to total
something and the number gets to big for the variabler
type, you get an overflow. If you happen to call to many
sub routines (nesting), you might be overflowing the
stack (which is a structure used to hold function/sub
return information and variables. There are host of other
possibilities...

Review the datatypes of your variables to make sure your
totals can "fit" into the variable type. Floating point
variable are usually able to hold large values than
integer types.

Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top