Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove Modules
Is it possible to build a code to remove excel vb module 1, module 2 and
module 3 that I have in my VBA project? For instance I'm trying to remove module 1 after I execute the macro, I then execute the macro in module 2 and remove module 2 ... Thanks, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove Modules
All explained nicely he
http://www.cpearson.com/excel/vbe.aspx RBS "Pedro Serra" wrote in message ... Is it possible to build a code to remove excel vb module 1, module 2 and module 3 that I have in my VBA project? For instance I'm trying to remove module 1 after I execute the macro, I then execute the macro in module 2 and remove module 2 ... Thanks, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove Modules
I'm trying to put the following code avalaible in the link u send me, but I
keep getting a compile error user-defined type not defined! Sub DeleteModule() Dim VBProj As VBIDE.VBProject Dim VBComp As VBIDE.VBComponent Set VBProj = ActiveWorkbook.VBProject Set VBComp = VBProj.VBComponents("Module1") VBProj.VBComponents.Remove VBComp End Sub Can u help me? Thanks, "RB Smissaert" wrote: All explained nicely he http://www.cpearson.com/excel/vbe.aspx RBS "Pedro Serra" wrote in message ... Is it possible to build a code to remove excel vb module 1, module 2 and module 3 that I have in my VBA project? For instance I'm trying to remove module 1 after I execute the macro, I then execute the macro in module 2 and remove module 2 ... Thanks, |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove Modules
Did you set the reference to the VBE Extensibility as explained in that
link? RBS "Pedro Serra" wrote in message ... I'm trying to put the following code avalaible in the link u send me, but I keep getting a compile error user-defined type not defined! Sub DeleteModule() Dim VBProj As VBIDE.VBProject Dim VBComp As VBIDE.VBComponent Set VBProj = ActiveWorkbook.VBProject Set VBComp = VBProj.VBComponents("Module1") VBProj.VBComponents.Remove VBComp End Sub Can u help me? Thanks, "RB Smissaert" wrote: All explained nicely he http://www.cpearson.com/excel/vbe.aspx RBS "Pedro Serra" wrote in message ... Is it possible to build a code to remove excel vb module 1, module 2 and module 3 that I have in my VBA project? For instance I'm trying to remove module 1 after I execute the macro, I then execute the macro in module 2 and remove module 2 ... Thanks, |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove Modules
You must have the Visual Basic for Applications Extensibility Libray referenced
under ToolsReferences. Chip points this out at the site you were guided to. Gord Dibben MS Excel MVP On Tue, 25 Sep 2007 05:54:00 -0700, Pedro Serra wrote: I'm trying to put the following code avalaible in the link u send me, but I keep getting a compile error user-defined type not defined! Sub DeleteModule() Dim VBProj As VBIDE.VBProject Dim VBComp As VBIDE.VBComponent Set VBProj = ActiveWorkbook.VBProject Set VBComp = VBProj.VBComponents("Module1") VBProj.VBComponents.Remove VBComp End Sub Can u help me? Thanks, "RB Smissaert" wrote: All explained nicely he http://www.cpearson.com/excel/vbe.aspx RBS "Pedro Serra" wrote in message ... Is it possible to build a code to remove excel vb module 1, module 2 and module 3 that I have in my VBA project? For instance I'm trying to remove module 1 after I execute the macro, I then execute the macro in module 2 and remove module 2 ... Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove Modules not working | Excel Programming | |||
Public, Private, Event modules, Forms modules,,, | Excel Programming | |||
Basic question - modules and class modules - what's the difference? | Excel Programming | |||
When to code in sheet or userform modules and when to use modules | Excel Programming | |||
Remove code from all modules closes Excel | Excel Programming |