2 out of 15 rated this helpful - Rate this topic

How to: Add New Worksheets to Workbooks

You can programmatically create a worksheet and then add the worksheet to the collection of worksheets in the workbook.

Applies to: The information in this topic applies to document-level projects and application-level projects for Excel 2007 and Excel 2010. For more information, see Features Available by Office Application and Project Type.

To add a new worksheet to a workbook in a document-level customization

To add a new worksheet to a workbook in an application-level add-in

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Add a new sheet in existing workbook on button click
Dim count As Integer = 0
Dim myExcel As Excel.Application
Private Sub btnNewSheet_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles btnNewSheet.Click
Globals.ThisAddIn.Application.Worksheets.Add()
xlSheet1 = Globals.ThisAddIn.Application.Worksheets.Item(1)
CType(xlSheet1, Excel._Worksheet).Activate()
xlSheet1.Name = "new sheet"
End Sub