Name

Application.NewWorkbook

Synopsis

Returns an Office NewFile object that represents an item on the New Workbook task pane. You can use this object to add or remove items from the task pane. For example, the following code adds the Invoice template and displays the task pane:

Sub TestNewWorkbook(  )
    With Application.NewWorkbook
      .Add "Invoice.xlt", _
        MsoFileNewSection.msoNewfromTemplate, _
        "New Invoice", MsoFileNewAction.msoCreateNewFile
    End With
    Application.CommandBars("Task Pane").Visible = True
End Sub

See the Office VBA help file (VBAOF11.CHM) for information about the NewFile object.

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.