Author Topic: Unloading all VBA projects..  (Read 3960 times)

0 Members and 1 Guest are viewing this topic.

hardwired

  • Guest
Unloading all VBA projects..
« on: June 06, 2008, 05:37:02 AM »
Hi,

In either lisp or vba, (posted this in both forums) is there a way of setting-up a command that unloads all vba projects, basically automating going through vbaman and unloading each project..

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Unloading all VBA projects..
« Reply #1 on: June 06, 2008, 09:55:47 AM »
I only have one big project and let it load the acad.dvb way and never unload it, is there an advantage to having lots of little ones?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Unloading all VBA projects..
« Reply #2 on: June 06, 2008, 10:20:48 AM »
I only have one big project and let it load the acad.dvb way and never unload it, is there an advantage to having lots of little ones?
I find small individual projects easier to manage
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Bob Wahr

  • Guest
Re: Unloading all VBA projects..
« Reply #3 on: June 06, 2008, 12:24:21 PM »
In response to the one big vs. lot's o little, I prefer each routine or routine group to be it's own dvb for the same reason that each project gets its own folder.  I can dump everything into the same one but that makes it more tedious to dig for what I need.

Opinion on unloading, is there a reason?  I load what I need, when I need it.  It unloads when I close acad and I don't notice any performance knock when doing it.

Answer to the question, there is no way using VBA alone to unload all VBA projects.  You can unload most of them, but a project can't be unloaded if it's running so it can't unload itself.

non-sequitur, I like coffee a lot.  It smells good, it tastes good, it makes my life fulfilled.

deegeecees

  • Guest
Re: Unloading all VBA projects..
« Reply #4 on: June 06, 2008, 12:39:00 PM »
As far as incorporating updates into your users Acad, here's how I used to do this:

All Lisp/VBA files reside in a directory for support files located on a network server and users AutCad support directory structure pointing to it. I would have my own profile for my testing, and the same one as the users. I'd switch between the two for testing. When things are working to my satisfaction, I'd send out an email to let the users know to shut down for 5 min while I transfer the files. If they didn't shut down Acad, then I'd usually get a call saying something locked up by the person who did not follow directions (didn't happen too much as they were a smart bunch).

And yes, each function had it's own file. This way some could be called without the overhead of a huge file.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Unloading all VBA projects..
« Reply #5 on: June 06, 2008, 02:05:25 PM »
what about a lisp command that loads, runs, and unloads the vba file?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

rogue

  • Guest
Re: Unloading all VBA projects..
« Reply #6 on: June 09, 2008, 12:34:30 PM »
I also have a "loader" dvb routine, with a small footprint. Since some of my routines use events, it's also an easy way to stop event polling.

fixo

  • Guest
Re: Unloading all VBA projects..
« Reply #7 on: June 10, 2008, 07:59:48 AM »
Hi,

In either lisp or vba, (posted this in both forums) is there a way of setting-up a command that unloads all vba projects, basically automating going through vbaman and unloading each project..

Not sure about that it's what you exactly need
This code will remove project from drawing
Just open VBAIDE, import this .bas file then run it:

Code: [Select]
' modCleanUp.bas ' <--Important! Save with this file name only
Option Explicit
' request reference to:
' Microsoft Visual Basic For Application Extensibility 5.3
Sub CleanUp()
Dim vbcom As VBComponent
On Error Resume Next
    For Each vbcom In ThisDrawing.Application.VBE.ActiveVBProject.VBComponents
        If vbcom.Name <> "modCleanUp" Then
            ThisDrawing.Application.VBE.ActiveVBProject.VBComponents.Remove vbcom
        End If
        Debug.Print vbcom.Name 'for the debug only
    Next vbcom
End Sub

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Unloading all VBA projects..
« Reply #8 on: June 10, 2008, 08:04:20 AM »
Another thread here with a possible solution.

http://www.cadtutor.net/forum/showthread.php?t=24053