We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

WorkSheet max row count exception

Thread ID:

Created:

Updated:

Platform:

Replies:

82278 Jun 8,2009 10:47 AM Jun 9,2009 05:05 AM Windows Forms 1
loading
Tags: XlsIO
Administrator [Syncfusion]
Asked On June 8, 2009 10:47 AM

Hi,
I have a problem with bellow code:

ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];

for (something)
{
row++;
sheet.Range[row, 1].Text = "something";
}
.......

when row == 65537 throws an exception:

Message: Specified argument was out of the range of valid values.
Source: Syncfusion.XlsIO.Web

Exception Stack Trace:
----------------------
at Syncfusion.XlsIO.Implementation.RangeImpl.CheckRange(Int32 row, Int32 column)
at Syncfusion.XlsIO.Implementation.RangeImpl.get_Item(Int32 row, Int32 column)

Geetha M [Syncfusion]
Replied On June 9, 2009 05:05 AM

Hi Mityo,

Thank you for your interest in Syncfusion products.

It is not possible to have more than 65536 rows in XLS format. It is the limitation of MS Excel and by default XlsIO creates the file in XLS format. But it is possible to have 1048576 rows in XLSX format. Please try using the code snippet given below:

IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2007;
IWorkbook workbook = application.Workbooks.Create(1);

and save the file in XLSX format as below:

workbook.SaveAs("Sample.xlsx");
workbook.Close();
excelEngine.Dispose();

Please try this and let me know if you have any questions.

Regards,
Geetha

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;