Troubleshoot Overflow

  • Thread starter Thread starter JingleRock
  • Start date Start date
J

JingleRock

I have read that the Overflow Error is frequently associated with
variable declaration. Do you have any suggestions, other than trial
and error in changing declarations, for troubleshooting this error?
Thanks for your help.
 
Formulate expresions to demand Double or Long math:

Sub bad_math()
MsgBox (24 * 60 * 60)
End Sub

will fail on overflow, but:

Sub good_math()
MsgBox (24# * 60 * 60)
End Sub

will work just fine.
 
hi
nope. this is one case where experience really does help but even so,
everyone hits an "oops" now and then
best way is to think out your declarations before hand.
in vb help look up data type summary for most of the fine points.

Regards
FSt1
 
Don't use "As Integer"; use "As Long".

Don't use "As Single"; use "as double".
 

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

Back
Top