Links between VBcomponents and Sheets

P

Paul

Each time a worksheet is added to a workbook, a new
VBComponent is added to the relevant VBProject. How does
Excel keep track of the link between the new component, a
memeber of the VBComponents collection, and the sheet, a
member of the Sheets collection? Also, how is the link
between the ThisWorkbook component and the actual
workbook managed? Thanks.
 
B

Bernie Deitrick

Paul,

The codemodule is a property of the worksheet:

ThisWorkbook.VBProject.VBComponents.("Sheet1").CodeModule

HTH,
Bernie
MS Excel MVP
 
B

Bernie Deitrick

Oops, I left an extra . in there....

ThisWorkbook.VBProject.VBComponents("Sheet1").CodeModule
 
Top