Skip to content

Latest commit

 

History

History
44 lines (25 loc) · 1.54 KB

Excel.Workbooks.Add.md

File metadata and controls

44 lines (25 loc) · 1.54 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Workbooks.Add method (Excel)
vbaxl10.chm203073
vbaxl10.chm203073
Excel.Workbooks.Add
ea9f2a2c-3cad-0c35-37b5-82da2f24b876
05/18/2019
medium

Workbooks.Add method (Excel)

Creates a new workbook. The new workbook becomes the active workbook.

Syntax

expression.Add (Template)

expression A variable that represents a Workbooks object.

Parameters

Name Required/Optional Data type Description
Template Optional Variant 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).

Return value

A Workbook object that represents the new workbook.

Remarks

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

[!includeSupport and feedback]