Home Dashboard Directory Help
Search

Excel.Worksheet.Rows.Count and Columns.Count returns wrong values by Freddy Bafuka


Status: 

Closed
 as By Design Help for as By Design


1
0
Sign in
to vote
Type: Bug
ID: 638870
Opened: 1/27/2011 10:46:27 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Using C#, Excel 2007 and Visual Studio Ultimate 2010:

Excel.Worksheet.Rows.Count returns 65536
Excel.Worksheet.Columns.Count returns 256 (IV)
Consistently, Excel.Worksheet.Cells.Count returns 16777216

The expected row count for Excel 2007 is over 1 million and column count should be to 16,384 (XFD).
See specs at: http://msdn.microsoft.com/en-us/library/ff700514.aspx
Details
Sign in to post a comment.
Posted by Microsoft on 2/2/2011 at 10:02 AM
Sorry, your original bug report didn't seem to indicate the version you were using or format you were saving. Saving As .xls is a format that is compatible with Excel 97-Excel 2003. The increased column format is only available in the .xlsx.

Actual Results:
Excel.Worksheet.Rows.Count = 65536
Excel.Worksheet.Columns.Count returns = 256

Expected Results:
Excel.Worksheet.Rows.Count = 1048576 Excel.Worksheet.Columns.Count returns = 16,384

If you have further questions about this issue I would suggest that you post to the Excel developer forum as they are the Excel experts.

http://social.msdn.microsoft.com/Forums/en-US/exceldev/threads

Thanks,
Rachel
Posted by Freddy Bafuka on 2/1/2011 at 2:59 PM
Please take a look at the link included above (in the description), scroll down to the Excel 2007 section. It states: "Starting in Excel 2007, the "Big Grid" increases the maximum number of rows per worksheet from 65,536 to over 1 million, and the number of columns from 256 (IV) to 16,384 (XFD)."
Posted by Microsoft on 2/1/2011 at 1:22 PM
The increased Row and Column count is only supported for Excel 2010 and not Excel 2007.
Posted by Freddy Bafuka on 1/28/2011 at 11:27 AM
Hi Ms. Schaw, when Excel 2007's save format is set to ".xls", the Excel.Worksheet.Rows.Count returns 65536 (instead of 1,048,576) and Columns.Count returns 256 (instead of 16,384) contrary to what is expected, as mentioned on the page you linked.

Thanks,

Freddy
Posted by Microsoft on 1/28/2011 at 10:55 AM
Thank you for reporting this issue.

The issue appears to be related to a Microsoft Office product. The Microsoft Office team does not use Microsoft Connect to collect customer feedback. In the future, please please contact product support at http://support.microsoft.com to report issues related to In order to report issues related to Microsoft Office or SharePoint.

I did do a quick Web search and found that this issue is By Design as per http://office.microsoft.com/en-us/excel-help/excel-specifications-and-limits-HP010342495.aspx?CTT=5&origin=HP005199291.

Thanks,
Rachel Schaw
Visual Studio
Posted by Microsoft on 1/27/2011 at 10:58 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.