Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Wed Oct 04, 2023 7:46 pm

Hi-

I am using this statement to create a new instance of a workbook...
Spire.Xls.Workbook shtTmp = new Spire.Xls.Workbook();

The issue I am having is that it is adding 3 worksheets that I can't remove.

Thanks
-Thomas

trozzi1957
 
Posts: 5
Joined: Sun Oct 14, 2018 10:58 pm

Thu Oct 05, 2023 3:29 am

Hi Thomas,

Thank you for your feedback regarding the issue with our xls product. We apologize for any inconvenience this has caused you.

Our xls product adds three default worksheets to the workbook when creating its instance. If you would like to delete any of these sheets, you can use the following code:
Code: Select all
workbook.Worksheets.Remove("sheet2");
workbook.Worksheets.Remove("sheet3");

This code will remove the sheet named "sheet2" and "sheet3" from the workbook. Please note that you will need to replace "sheet2" or "sheet3" with the name of the sheet you would like to delete.

If you have any further questions or concerns, please do not hesitate to contact us.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.XLS