Hi there,
I need to have some object during all excel session. I have some class module and need to access the object of that. Now I have some trouble when using it - everytime I access the object the constructor is called each time and all old values/settings within the object are missed and even destructor is called after each access.
I would need to declare it on the start and on the end only like that:
Private Sub Workbook_Open()
Set custom_object = New TCustom_Object
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Set custom_object = Nothing
End Sub
And then access it from VA modules like Global variable
Module1 :: Public Sub make_change1()
custom_object.
End Sub
Module2 :: Public Sub make_change2()
custom_object.
End Sub
I've tried to declare it as Static object inside procedure - still no work.
Public Sub...
Static custom_object As New TCustom_Object
Any idea ? TIA
Bookmarks