CONNECT - Problem with Autoloaded VBA's using Multiple Configurations

While setting up our Open Roads Configuration, we loaded a number of other agency configurations to compare different approaches to setting up Element Templates and other settings. This also was our first look at the new Manage Configuration tool. Since we have to support a lot of consultants using our workspaces, I took the opportunity to experiment with multiple locations to store Configurations. This included installing out own in multiple locations.

What I discovered, is that many of our Autoloading VBA projects are loading more than once as one WorkSpace loads by default but then we try to switch to a different WorkSpace.

This used to happen to me when I was working for a consultant using V8. You could close (Ctrl+W) to change projects/clients, but the Autorun VBA's remained loaded. I wrote some of my own VBA code to compare loaded VBA's to the list of Autoload VBA's and unloading those that were no longer in the client's list. It mostly worked, but I still told users that when switching projects, to open a file in the new project after switching, but then to exjit and restart.

I guess the problem is that once loaded, only certain actions will unload a VBA and changing WorkSpaces is not one of those things.

Parents
  • use this vba hook event.  You can search internet for info from the guy who wrote it.  I use it all the time in our custom configurations.

    bjmoon

    ' ORIGINAL APPLICATION DESCRIPTION & ORIGINAL AUTHOR
    ' OF AUTOMATIC OPEN/CLOSE HOOK EVENTS
    '------------------------------------------------------------
    'Demonstrates the basic hooks to:
    'Automatically load and execute a VBA Macro when MicroStation opens.
    'Execute a macro for every design file that is opened / closed.
    'This example performs the following functions:
    ' FileOpen - Closes all views except View 1 and performs a fit all
    ' FileClose - Detach All Reference Files
    '------------------------------------------------------------
    'modMain:
    ' Holds reference to class that monitors events
    ' Executes OnprojectLoad / OnProjectUnload methods when
    ' MicroStation runs and ends
    '
    'Support:
    'Gerald Hernandez
    'Geospatial Paradigm Solutions, Inc.
    '10303 E DRY CREEK RD, STE 150
    'ENGLEWOOD COLORADO 80112
    'http://www.GPSBroadband.com
    'mailto:Cablewizard@Yahoo.com

Reply
  • use this vba hook event.  You can search internet for info from the guy who wrote it.  I use it all the time in our custom configurations.

    bjmoon

    ' ORIGINAL APPLICATION DESCRIPTION & ORIGINAL AUTHOR
    ' OF AUTOMATIC OPEN/CLOSE HOOK EVENTS
    '------------------------------------------------------------
    'Demonstrates the basic hooks to:
    'Automatically load and execute a VBA Macro when MicroStation opens.
    'Execute a macro for every design file that is opened / closed.
    'This example performs the following functions:
    ' FileOpen - Closes all views except View 1 and performs a fit all
    ' FileClose - Detach All Reference Files
    '------------------------------------------------------------
    'modMain:
    ' Holds reference to class that monitors events
    ' Executes OnprojectLoad / OnProjectUnload methods when
    ' MicroStation runs and ends
    '
    'Support:
    'Gerald Hernandez
    'Geospatial Paradigm Solutions, Inc.
    '10303 E DRY CREEK RD, STE 150
    'ENGLEWOOD COLORADO 80112
    'http://www.GPSBroadband.com
    'mailto:Cablewizard@Yahoo.com

Children
No Data