How to: Programmatically Create New Workbooks

When you create a workbook programmatically, it is a native Workbook object, not a Workbook host item.

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

You can generate a Workbook host item for a Workbook object in an application-level project. For more information, see Extending Word Documents and Excel Workbooks in Application-Level Add-ins at Run Time.

To create a new workbook

  • Use the Add method of the Workbooks collection.

    Excel.Workbook newWorkbook = this.Application.Workbooks.Add();
    Note Note

    You can create a workbook based on a template other than the default template: pass the template you want to use as a parameter to the Add method.