Help me What is wrong in this code?

Help me. What is wrong in this code?

oWBook = application.Workbooks.Open(strTemplate & "\RPT\SALEANDPROFIT02.xls")
oSheet1 = oWBook.Worksheets("Sheet1")
oSheet2 = oWBook.Worksheets.AddCopy(oWBook.Worksheets(0))
oSheet2.Name = ddlmaker.SelectedValue
oSheet2.Activate()


ERROR :
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.Collections.ArrayList.get_Item(Int32 index) +2776237
Syncfusion.XlsIO.Implementation.Collections.WorksheetsCollection.get_Item(Int32 Index) +71
PRT_SALEANDPROFITBYCARLINE.btnSubmit_Click(Object sender, EventArgs e) +409
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105


1 Reply

GM Geetha M Syncfusion Team June 26, 2009 11:13 AM UTC

Hi,

Thank you for your interest in Syncfusion products.

I am afraid that I am not able to see the problem. Could you please send us the Excel file that throws the exception and details of the Essential Studio version you are currently running?

Regards,
Geetha

Loader.
Up arrow icon