Microsoft KB Archive/191006

= DOC: FlexGrid Control Is Limited to 350,000 Total Cells =

Article ID: 191006

Article Last Modified on 10/26/2007

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q191006



SUMMARY
The FlexGrid control is limited to 350,000 total cells. This limitation differs from the limitation that is documented in the FlexGrid Help file. The Help file states the following:

"The minimum number of rows and columns is 0. The maximum number is limited by the memory available on your computer."

Although this statement is true for the Hierarchical FlexGrid control (MSHFLXGD.OCX), it is incorrect for the FlexGrid control (MSFLXGRD.OCX).



MORE INFORMATION
This limitation of 350,000 cells occurs on any computer, regardless of the memory that is available. Thus, if you have two columns, the maximum amount of rows that you can have is 175,000. Similarly, if you have five columns, the maximum amount of rows that you can have is 70,000. If any combination of rows and columns exceeds 350,000 total cells, you receive the following error message:

Unable to Allocate Memory for FlexGrid

Steps to Reproduce Behavior
 Create a new Standard EXE project. Form1 is created by default. Click Components on the Project menu, and then select the Microsoft FlexGrid Control 6.0 check box. Add a FlexGrid control to Form1. Set the Cols property of MSFlexGrid1 to 2 in the Properties window. Set the Rows property of MSFlexGrid1 to 175,001 in the Properties window (the maximum it allows in this case is 175,000). You receive the following error message:

Unable to Allocate Memory for FlexGrid



Keywords: kbproductlink kbbug kbctrl kbdocerr kbnofix KB191006

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.