• 3 replies
  • Latest Post - ‏2012-10-03T18:14:37Z by TerryMoriarty
126 Posts

Pinned topic SA or VBA Event

‏2012-10-02T15:35:54Z |
I'm reverse engineering a macro developed for me by an SA consultant who is long gone. The code works, but I want to clean it up by removing some extraneous subroutines, documenting it and putting it into production.

In stepping through the autoexec module the following code is executed, but not called from anywhere.

Private Sub Class_Initialize()
Set App = Application
End Sub

Private Sub Class_Terminate()
Set App = Nothing
End Sub

I'm guessing these are events, but I don't know how they are being initiated. They are not documented in the SA VBA help guide, but this wouldn't be the first time that an SA "feature" isn't documented. or they could be VBA events. I don't now what "class" cause these events to be raised.

Anyone have an idea of what's going on?

Updated on 2012-10-03T18:14:37Z at 2012-10-03T18:14:37Z by TerryMoriarty
  • SystemAdmin
    1061 Posts

    Re: SA or VBA Event

    You can always comment them out and see if something breaks. Not sure what the 'menu' call is doing all by itself. Check the other modules to see if those calls are used, other than that - they kind of look harmless.
  • ArifH
    30 Posts

    Re: SA or VBA Event

    Mentioned here

    but does not give much information.
    Same information appears in older documents.
  • TerryMoriarty
    126 Posts

    Re: SA or VBA Event

    Found out from the SA linkedIn group that these are VBA events. They appear to be invoked when the EventHandler is created. I'm thinking of moving the call for the menu subroutine to the Startup event. or just make the call directly from the Main subroutine.