This documentation is archived and is not being maintained.

Workbooks.Add Method 

Creates a new workbook. The new workbook becomes the active workbook. Returns a Workbook object.

Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in

Dim Template As Object
Dim returnValue As Workbook
Dim workbooks1 As Workbooks
returnValue = workbooks1.Add(Template)

Workbook Add(
	[In, Optional] object Template
public Workbook Add(
	/*in*/System.Object Template
function Add(
	 Template : Object
) : Workbook;



Optional Object. Determines how the new workbook is created. If this argument is a string specifying the name of an existing Microsoft Excel file, the new workbook is created with the specified file as a template. If this argument is a constant, the new workbook contains a single sheet of the specified type. Can be one of the following XlWBATemplate constants: xlWBATChart, xlWBATExcel4IntlMacroSheet, xlWBATExcel4MacroSheet, or xlWBATWorksheet. If this argument is omitted, Microsoft Excel creates a new workbook with a number of blank sheets (the number of sheets is set by the SheetsInNewWorkbook property).

If the Template argument specifies a file, the file name can include a path.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms