Search notes:

Office Object Model: Excel - Parent

The objects range, worksheet and workbook each have a parent property which returns the instance of which they're part of: range.parent returns a worksheet, worksheet.parent returns a workbook, workbook.parent returns an Application object.
The following piece of code tries to demonstrate that:
option explicit

sub main() ' {

    dim obj as object
    set obj = cells(1, 1)

    getParent obj
    getParent obj
    getParent obj


end sub ' }

sub getParent(byRef obj as object) ' {

  '
  ' Save old typeName
  '
    dim typeName_ as string : typeName_ = typeName(obj)

  '
  ' get obj's Parent
  '
    set obj = obj.parent

  '
  ' print both old and new typename
  '
    debug.print typeName_ & " -> " &  typeName(obj)

end sub ' }
Github repository about-MS-Office-object-model, path: /Excel/parent/chain.bas
This code prints:
Range -> Worksheet
Worksheet -> Workbook
Workbook -> Application

See also

Insert a workbook's directory name into a cell
Excel Object Model

Index