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. Image for the cookie policy date
close icon

Worksheet.Rows property throws ArgumentOutOfRangeException

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

2 Replies

TR Terence Rossow October 30, 2007 03:11 AM UTC

Should have mentioned - Visual Studio 2005, Syncfusion 5.1.1.0.

Cheers,
TERRY


RS Rajarajeswari S Syncfusion Team October 31, 2007 09:24 AM UTC



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


Loader.
Live Chat Icon For mobile
Up arrow icon