Workbook.Root
Use this property to get the root folder of the workbook. This property is read only.
SVB Example
Looping through items in a workbook.
Option Base 1 Option Explicit Sub Main Dim w As Workbook Set w = ActiveWorkbook 'set the pointer to the beginning of the workbook tree Dim CurrentItem As WorkbookItem Set CurrentItem = w.Root 'loop until you reach the last node in the workbook tree Do While TypeName(CurrentItem) <> "Nothing" Set CurrentItem = w.NextItem(CurrentItem) 'the last node in the workbook tree has been reached. If TypeName(CurrentItem) = "Nothing" Then Exit Do 'if it's a spreadsheet then print it If CurrentItem.Type = scWorkbookItemTypeSpreadsheet Then CurrentItem.Activate w.PrintOut(True, False) End If Loop End Sub
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.