...
As it seems to me, this won't be a real extension (e.g.
adding new events and properties to a class).
You can add Public (or Friend) properties and methods to the Sheet1
code module e.g.
Public Property Get MyProperty() As String
MyProperty = "Blah"
End Property
You can even add and raise a public event in the Sheet1 code module
(but who sees it?)
It seems to have a hidden line:
Private WithEvents Worksheet As AMuchMoreComplexAnimal
Elsewhere, there seems to be a single Sheet1 object variable. You can
call e.g. the property added above wherever this object variable is in
scope.
Sheet1 is a bit like UserForm1 in that it of type UserForm but also a
class in its own right i.e. you can add custom properties, methods and
events. Unlike UserForm1, however, you can't create an instance of
Sheet1:
Dim oSheet1 As Sheet1
Set oSheet1 As New Sheet1
The second line (note *only* the second line) gives a compile error.
So its instancing type must be GlobalMultiUse. But it has no
Initialize nor Terminate event, so it isn't even a class.
So what is Sheet1? It's not a Worksheet, because this fails:
Public Function SayBlah(ByVal oSheet As Worksheet)
MsgBox oSheet.MyProp
End Function
But change to:
Public Function SayBlah(ByVal oSheet As Object)
MsgBox oSheet.MyProperty
MsgBox TypeName(oSheet)
End Function
Public Sub test()
SayBlah Sheet1
End Sub
And this time it works. But now it says the object type is Worksheet!
I trust this clarifies things <g>.
Jamie.
--