More than 3 sheets in a Workbook

Technical support for Spire.XLS

Moderators: iceblue support, Flash, Manager

More than 3 sheets in a Workbook

Postby leep » Thu Feb 23, 2012 1:36 pm

I got an exception when I tried to add the fourth sheet to a Workbook, and the exception was saying that
"Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index"

Is it possible to create more than 3 sheets in a Workbook?
leep
 
Posts: 1
Joined: Tue Feb 21, 2012 6:22 am

Re: More than 3 sheets in a Workbook

Postby Suvi.Wu » Fri Feb 24, 2012 3:38 am

Hello leep,

Thanks for evaluating Spire.XLS.

With Spire.XLS, you can create the same amount of worksheets as MS Excel. When you create a workbook using spire.XLS, it includes 3 sheets automatically.But If you have not buy our products license, the workbook will be inserted a warning sheet named “Evaluation Warning". When you open the xls file which has been oprated by Spire.XLS, it always show the warning sheet when you open. Then you can use the code " workbook.CreateEmptySheet()" to add a sheet into workbook, in the parenthese, you can named the worksheet you added. You can also use this code "workbook.CreateEmptySheets(10)" to add multiple sheets one time. After adding a sheet, you can use this code "Worksheet sheet4 = workbook.Worksheets[3]" to get the fourth sheet.

If you still have this question,please feel free to contact us at any time.
Have a great day.

BR
Suvi
e-iceblue support
User avatar
Suvi.Wu
 
Posts: 156
Joined: Thu Oct 20, 2011 2:53 am


Return to Spire.XLS

Who is online

Users browsing this forum: No registered users and 0 guests