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.Rows property throws ArgumentOutOfRangeException

Thread ID:

Created:

Updated:

Platform:

Replies:

69485 Oct 29,2007 11:11 PM Oct 31,2007 05:24 AM Windows Forms 2
loading
Tags: XlsIO
Terence Rossow
Asked On October 29, 2007 11:11 PM

Hi there,

I'm using some code we wrote on version 3 of the Syncfusion libraries to export a GridControl to Excel (using XlsIO or ExcelRW as I think it was called at the time). It worked like a charm back then. I haven't really visited this since then, but I'm back now, and we've upgraded to version 5 of SF. Now I'm getting some strange exception on the IWorksheet.Rows property.

We create the sheet using the ExcelEngine.Excel.Workbooks.Create(count) function, and then reference the sheet lower down. But as soon as the sheet is created, referencing the Rows property shows an exception - and not with the index value passed to Rows - something is happening in the code in the Rows property.

I use similar code elsewhere that works fine - but in that code I do not pass a number of sheets to the Workbooks.Create() function - I simply call the default function.

Any ideas would be most appreciated.

Cheers,
TERRY

Terence Rossow
Replied On October 29, 2007 11:11 PM

Should have mentioned - Visual Studio 2005, Syncfusion 5.1.1.0.

Cheers,
TERRY

Rajarajeswari S [Syncfusion]
Replied On October 31, 2007 05:24 AM



Hi Terry,

Thanks for using Syncfusion proucts.

I am afraid that i am not able to reproduce the problem that you have mentioned here. Please refer to the following steps that i tried to reproduce it.

1. I have created a sample in XlsIo.
2. I have created workbook by calling the Create(count) method.
3. I have also used the Rows property to make first row to become bold.
4. It works fine here.

Please refer the below code snippet which illustrates this.

IWorkbook workbook = application.Workbooks.Create(3);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].Text = "hello world";
sheet.Rows[0].CellStyle.Font.Bold = true;

Also i have created a simple sample to test this problem and it is available in the following link.

http://websamples.syncfusion.com/samples/XlsIO.Windows/F69485/main.htm

Please have a look at the above sample and if still the problem exists, could you please try reproducing it in the above sample or send us the reproducing steps so that we could sort out the cause of the issue and provide you a solution.

Regards,
S.Rajarajeswari


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.

;