We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Why does the workbook automatically have Sheet1 and how can I get rid of it?

I can’t use IsVisible = false because that seems to screw everything up where tabs don’t click on right and the sheet itself seems not stable at all with refreshing issues etc.

Hi,

Well, when you create a new Workbook, by default Sheet1 is added to the worksheets collection. It's very simple to remove the default worksheet "Shee1" in the workbook, you may use Worksheets.RemoveAt() method or use Worksheets.Clear() method for the task. The second method will remove all the sheets including the "Sheet1".

Sample code:

1).
// Create a Workbook.
Workbook wb = new Workbook();
// Clear all the Worksheets including Default Sheet1.
wb.Worksheets.Clear();
// Add a new Worksheet
int i = wb.Worksheets.Add();
// Create a Worksheet object and get the first sheet
Worksheet sheet = wb.Worksheets[i];
// Name the sheet.
sheet.Name = "MyTestSheet";
// Save the Workbook
wb.Save("f:\\test\\SheetsTest.xls");


2).
// Create a Workbook.
Workbook wb = new Workbook();
// Remove the Sheet1.
wb.Worksheets.RemoveAt("Sheet1");
// Add a new Worksheet
int i = wb.Worksheets.Add();
// Create a Worksheet object and get the first sheet
Worksheet sheet = wb.Worksheets[i];
// Name the sheet.
sheet.Name = "MyTestSheet";
// Save the Workbook
wb.Save("f:\\test\\SheetsTest.xls");

And for further reference, please check the doc:

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/managing-worksheets.html

Thank you.