JTBorton,
I use both the default and default enum settings to keep my own classes consistent with other built in classes, so I think it's worth the extra steps needed to incorporate into custom classes. Here are some examples of how/where they can be used.
Default property: Good example is the [tt]Excel.Worksheets[/tt] class. The default property is [tt]_Default[/tt], this allows you to grab a worksheet using [tt]Worksheets("Sheet1")[/tt] in leiu of using the fully qualified [tt]Worksheets.Item("Sheet1")[/tt]
Default Enum: Allows you to do a [tt]For...Each[/tt] loop on your class (I do a lot of collection classes) instead of doing a [tt]For...Next[/tt] loop.
Code:
For Each [i]Worksheet[/i] In ThisWorkbook.Worksheets
[tab]'Do somenting
Next [i]Worksheet[/i]
You won't find them in .Net, these settings are now stored in the .proj file and not in the class itself, to find the VBA stuff you have to go back to Visual Basic 6.
You don't have to make them add-ins to share. From the IDE you can go to Tools > References, then browse to the Excel file that has the code you want to share just like you would another library. Just be sure any users of a workbook built this way have access to the file you have as a reference.
If your going to follow combo's advice and 'Lock the Project for viewing' you will need to set the instancing for you class modules to PublicNotCreatable or else the class will be completely hidden in the Object Browser.
CMP
[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)