This refers to the path of the local directory with add-in files.
This refers to the local Templates directory
This refers to the local xlstart directory
Options > VBA Code > Folder Paths
There are no properties to determine the global templates and startup directories.
This creates a new empty workbook with the default number of worksheets
It is possible to create a new workbook that contains just a single worksheet:
It is also possible to create a new workbook that contains just a single chart sheet:
Reference to New Workbook
A better approach is to use the return value from the Add method to create an object variable referring to the workbook.
Dim wbk As Workbook
Set wbk = Workbooks.Add
wbk.Range("A2").Value = "some text"
This can be useful for keeping track of temporary workbooks without the need to save them.
The Add method also lets you specify a template to use for your new workbook.
When the argument is a string specifying the folder location of an existing workbook the new workbook is created using this workbook as the template.
Set wbk = Workbooks.Add (Template:="C:\Temp\"wbkTemplate.xls")
© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext