Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Overflow Error

1 view
Skip to first unread message

jing

unread,
Aug 20, 2002, 12:45:36 AM8/20/02
to
Does anyone know why the Overflow error occurs? The
Microsoft site says there is a fix, but we've got the most
recent update.

I get the error on this code:

Dim TableWidth as Integer
TableWidth = Selection.Tables(1).Cell(1, 1).Width

thanks.

Dave Lett

unread,
Aug 20, 2002, 2:25:07 PM8/20/02
to
Hi Jing,

Have a look at the VBA Help file topic "Overflow (Error 6):

You get this error because "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."

HTH

"jing" <ji...@hlhz.com> wrote in message
news:411b01c24804$6cfe7640$37ef2ecf@TKMSFTNGXA13...

jing

unread,
Aug 20, 2002, 4:00:55 PM8/20/02
to
But I test for the the number that is being retrieved and
it is not larger than an integer. I get this error
randomly--with the same number.

Jonathan West

unread,
Aug 21, 2002, 3:39:17 PM8/21/02
to
Hi jing,

The Width property is of type Long, not Integer. Change this line

Dim TableWidth as Integer

to this

Dim TableWidth as Long


--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email

"jing" <ji...@hlhz.com> wrote in message

news:543201c24884$4b08dc30$9ee62ecf@tkmsftngxa05...

Steve Hudson

unread,
Aug 24, 2002, 4:35:24 PM8/24/02
to
G'day "jing" <ji...@hlhz.com>,

its always dangerous using the absolute cell reference in that way. A
better way is this

Get the row's range
then use .cells(cell number)

However, your problem is porbably due to the fact you are trying to
use an Integer to do the work of a Long. .Width returns a Long so use
that datatype instead.


"jing" <ji...@hlhz.com> was spinning a yarn that went like this:

Steve Hudson -- Word Heretic, Sydney, Australia
Freelance teacher, trainer, tutor, writer, developer
Email: her...@tdfa.com Blog and FAQs: http://blog.tdfa.com
Word MVP FAQs: http://www.mvps.org/word/FAQs/index.html
You agree by writing to me personally that any material can be reused publicly unless you explicitly disclaim it. (For List and blog use.)

0 new messages