Workbook.InsertFolder
Use this function to insert a folder into the workbook.
SVB Example
Inserting a folder into a workbook:
Option Base 1
Option Explicit
Sub Main
Dim wb As Workbook
'assigns the new workbook to the object wb
Set wb = Workbooks.New("WB Example")
Dim newfolder As WorkbookItem
'assigns/inserts the new folder into the
'root folder of the workbook as the first child
Set newfolder = wb.InsertFolder(wb.Root,scWorkbookFirstChild)
'sets the name of the folder to Example Folder
newfolder.Name = "Example Folder"
'sets the workbook to visible
wb.Visible = True
End Sub
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.
