View Single Post
 
Old 02-14-2012, 02:58 PM
Jamal NUMAN Jamal NUMAN is offline Windows 7 64bit Office 2010 64bit
Expert
 
Join Date: Nov 2010
Posts: 615
Jamal NUMAN is on a distinguished road
Thumbs up

Quote:
Originally Posted by Colin Legg View Post
Hi Jamal,

If you select all of the cells on the sheet at once you will get a runtime error. It's a small detail, but it can easily happen if someone clicks on the square as indicated in the screenshot I've attached.

It's because the Range.Count property was originally designed for pre-2007 worksheets which were smaller. Specifically, the Range.Count property returns a 32-bit Long Integer which can hold a maximum value of 2,147,483,647, but a worksheet in a 2007/10 format file has 17,179,869,184 cells, which is too large to be held in a Long Integer type.

When the gridsize increased in the Excel 2007 release, it was accompanied by a new Range.CountLarge property which can handle the larger grid.
thank you for the elaboration Colin Legg. your contribution is quite useful.

best

Jamal
Attached Images
File Type: jpg Clip_110.jpg (120.3 KB, 17 views)
File Type: jpg Clip_111.jpg (115.1 KB, 18 views)
Reply With Quote