View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick[_2_] Bernie Deitrick[_2_] is offline
external usenet poster
 
Posts: 176
Default Documentation for VBProject

Wes,

The remove codemodule command is a little convoluted, since your use the .Remove method on the VBComponents collection, and pass the
module to be removed as an object:

With ActiveWorkbook.VBProject
..VBComponents.Remove .VBComponents("myModule")
End With

OR

ActiveWorkbook.VBProject.VBComponents.Remove _
ActiveWorkbook.VBProject.VBComponents("myModule")

Importing is the same general idea, except you pass a string with the filename and path.

ActiveWorkbook.VBProject.VBComponents.Import "C:\Excel\myModule2.bas"

The codemodule is actually removed immediately: I learned this technique
from Rob Bovey's VBA Code Cleaner, which you can find through Google.
His code is unprotected - which is very nice of Rob - so you can learn from
a master.

HTH,
Bernie
Excel MVP


"Wes Jester" wrote in message ...
I am trying to find the documentation for VBProject without much success.
The difficulty I am having is in Removing and Importing modules. During
this process, the module is not acutally removed until the maintenance
module is exited. Therefore, all the names of the imported modules have a 1
appened to it.

I want to setup another module to call that will go thru the modules and
rename them back to the original names. So, I am looking for all the
methods and properties available for VBProject

Thanks

Wes