Error Message Appears If Array Contains More Than 2,730 Elements (137921)
The information in this article applies to:
- Microsoft Excel for Windows 95
- Microsoft Excel for Windows NT 5.0
This article was previously published under Q137921 SYMPTOMS
In Microsoft Excel 5.0 for Windows NT and Microsoft Excel 7.0, an array in
a macro can contain a maximum of 2,730 elements. If you create an array
definition that exceeds this limit, you receive the following error
message:
Run-time error 1006
Unable to get the value property of the range class
Note that this behavior is different from Microsoft Excel version 5.0 and
earlier versions for Windows. In these versions of Microsoft Excel, an
array macro definition can contain up to 3,276 elements.
CAUSE
This problem occurs because array definitions are limited to one 65,536-
byte (64K) segment of memory. In the 32-bit versions of Microsoft Excel, a
value is stored in 24 bits. Because an array definition cannot exceed one
segment of memory, the number of elements that can be stored in an array
cannot exceed 2,730.
REFERENCES
"Visual Basic User's Guide," version 5.0, Chapter 6, "Working with Visual
Basic Code in Procedures"
For more information about Arrays In Microsoft Excel 7.0, click Answer
Wizard on the Help menu, and type:
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbcode kbdtacode kberrmsg kbprb kbProgramming KB137921 |
---|
|