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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1758199734, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/Office/Excel/Object-Model/parent/index(81): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78