Run time Error 6

B

Bill Martin

I have a friend who is not too computer savvy to whom I sent a simple XLS
that contains a VBA macro I wrote to do some simple sorting of one of the
sheets. When he runs it on his machine he gets what he claims is a "run
time error 6" message. It's not clear to me sitting 5,000 miles away
whether this is an Excel error or a VBA error message.

What's frustrating to me is that I've typed every variation of the error
message I can think of into both the Excel and VBA help systems and they
don't come back with any explanation of what it means. Can anyone here
point me to a source of explanations for messages of the "error 6" variety?

FWIW, my system is Office 2003, while his is Office 2003 Professional. My
understanding, perhaps misguided, is that those two systems have identical
Excel packages though. The difference lies only in the inclusion of
database software. Both systems are running under XP-Home.

Thanks.

Bill
 
J

Jim Cone

Bill,
Error 6 is an "overflow" error.
Lookup "trappable errors" in vba help.
One of the most common reasons for this error occurring is
using an Integer variable as a row designator.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Bill Martin"
<[email protected]>
wrote in message
I have a friend who is not too computer savvy to whom I sent a simple XLS
that contains a VBA macro I wrote to do some simple sorting of one of the
sheets. When he runs it on his machine he gets what he claims is a "run
time error 6" message. It's not clear to me sitting 5,000 miles away
whether this is an Excel error or a VBA error message.

What's frustrating to me is that I've typed every variation of the error
message I can think of into both the Excel and VBA help systems and they
don't come back with any explanation of what it means. Can anyone here
point me to a source of explanations for messages of the "error 6" variety?

FWIW, my system is Office 2003, while his is Office 2003 Professional. My
understanding, perhaps misguided, is that those two systems have identical
Excel packages though. The difference lies only in the inclusion of
database software. Both systems are running under XP-Home.

Thanks.

Bill
 
D

Dave Patrick

runtime error 6 = overflow. Possibly an array index out of bounds.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
|I have a friend who is not too computer savvy to whom I sent a simple XLS
| that contains a VBA macro I wrote to do some simple sorting of one of the
| sheets. When he runs it on his machine he gets what he claims is a "run
| time error 6" message. It's not clear to me sitting 5,000 miles away
| whether this is an Excel error or a VBA error message.
|
| What's frustrating to me is that I've typed every variation of the error
| message I can think of into both the Excel and VBA help systems and they
| don't come back with any explanation of what it means. Can anyone here
| point me to a source of explanations for messages of the "error 6"
variety?
|
| FWIW, my system is Office 2003, while his is Office 2003 Professional. My
| understanding, perhaps misguided, is that those two systems have identical
| Excel packages though. The difference lies only in the inclusion of
| database software. Both systems are running under XP-Home.
|
| Thanks.
|
| Bill
|
 
B

Bill Martin

Hmm... You may well be right. I'll try redimensioning it as LONG and send
the file off to see what happens. It is curious though why it should work
on my machine and fail on his since they're both the same version of Excel
running a small XLS file. Quite possibly his machine has less RAM installed
though.

Thanks...

Bill
 
B

Bill Martin

No arrays are used, but I was using Integer for a row value rather than Long
as Jim suggested. The value never gets over 50 or so, but perhaps it's some
sort of internal problem.

Thanks Dave.

Bill
 
J

Jim Cone

Maybe some of his data is in the bottom half of the worksheet?
--
Jim Cone
San Francisco, USA
http://www.officeletter.com/blink/specialsort.html


"Bill Martin"
<[email protected]>
wrote in message
Hmm... You may well be right. I'll try redimensioning it as LONG and send
the file off to see what happens. It is curious though why it should work
on my machine and fail on his since they're both the same version of Excel
running a small XLS file. Quite possibly his machine has less RAM installed
though.
Thanks...
Bill
 
D

Dave Patrick

The max row number in excel is 65536 but perhaps your code added one to the
row number.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| No arrays are used, but I was using Integer for a row value rather than
Long
| as Jim suggested. The value never gets over 50 or so, but perhaps it's
some
| sort of internal problem.
|
| Thanks Dave.
|
| Bill
| ---------------------------------
 

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