I am wondering if, in VBA, it's possible to define and create a class object that is a specific instance of another, existing class object. For example, I would like to create a class called SpecialWorkbook which has properties specific to a unique workbook (class) in my directory. These properties would include Path, Name, FullName (Path & Name), Password, etc.
I know it would be possible to access all of the properties of the Application.Workbook class --
With Application.Workbooks(SpecialWorkbook.Name)
-- but that route may seem unintuitive to a user since the SpecialWorkbook class does not have the properties and methods of a standard Workbook class.
Would it be possible to do something like:
'In Class Module "SpecialWorkbook"
Private Sub Class_Initialize()
Dim SpecialWorkbook as Workbook
Set SpecialWorkbook = Application.Workbook("SpecialFileName.xlsx")
End Sub
And then use it like:
'In Standard Module
SpecialWorkbook.sheets.count
The above "for instance" obviously doesn't work but that's the general idea I would like to implement if possible.
Thanks in advance!