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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Column and row restriction in XLSIO

Thread ID:





117584 Nov 12,2014 04:56 AM UTC Nov 17,2014 12:19 PM UTC WPF 3
Tags: XlsIO
Asked On November 12, 2014 04:56 AM UTC

I have a code which writes data of around 256+ columns into worksheet in a workbook. But after writing 256 columns I got an exception telling that arguement is out of range. I tried to resolve this by reading the currently installed excel version on my machine using IWorkbook's  Version property thinking that I would get more columns in Office 2010,but it gives only Off97to2003 everytime eventhough I have Office 2010 installed on my machine.

Need help

Prakash Kumar D [Syncfusion]
Replied On November 12, 2014 11:03 AM UTC

Hi Mahesh,


Thank you for using Syncfusion Products.


The reported exception is raised due to invalid workbook version. The default version in XlsIO is Excel97-2003. In that case, if you try to add 256+ columns, it will throw exception. We recommend you to assign it to Excel2007 or later. Please refer the below code snippets to avoid the exception. We have also shared a sample for your reference. Kindly refer to this and let us know if your issue is resolved.


Code Snippet:



//Step 1 : Instantiate the spreadsheet creation engine.

ExcelEngine excelEngine = new ExcelEngine();

//Step 2 : Instantiate the excel application object.

IApplication application = excelEngine.Excel;


application.DefaultVersion = ExcelVersion.Excel2010;

//If 2003 format file is opened and tried to add 256+ columns,

//workbook version must be assigned
IWorkbook workbook = application.Workbooks.Open(“sample.xls”);

workbook.version = ExcelVersion.Excel2010;



Sample Link:  Sample.zip


NOTE: This version settings doesn’t relate to the office version installed in the machine.


Please let us know if you need any clarification.



Prakash Kumar.

Replied On November 14, 2014 07:20 AM UTC

On changing the version of excel to Excel2007 I am unable to format the excel. My code has stopped working.
Please see the attahced screenshots.

Attachment: Chart_8b5860e1.zip

Prakash Kumar D [Syncfusion]
Replied On November 17, 2014 12:19 PM UTC

Thank you for updating us.


We have analyzed the given screenshot and found that data labels are visible and makes the chart unreadable, for which we suggest you to disable the data labels in the series by using the below code snippets.


Code Snippet:



 IChartSeries series = chart.Series;

    series[0].DataPoints.DefaultDataPoint.DataLabels.IsValue = false;


However, if you could share us the below information in detail, it will be helpful to investigate further on this.

1.     Code snippets or the scenario you use that causes the program to stop working

2.     What kind of formatting you are trying to apply and what is the output you are getting?


Please clarify us with the above queries and let us know if you need any clarification.



Prakash Kumar.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon