Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing a module with code
Hi
Is it possible to remove a module (with code) that is located in another workbook. Here's what I need to do: I would like to run code from an addin file that would remove module1 in the activeworkbook . Any help would be greatly appreciated. Thanks! Kimberly |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing a module with code
Kimberly,
Try something like With ActiveWorkbook.VBProject.VBComponents .Remove .Item("Module1") End With See www.cpearson.com/excel/vbe.htm for more details. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "KimberlyC" wrote in message ... Hi Is it possible to remove a module (with code) that is located in another workbook. Here's what I need to do: I would like to run code from an addin file that would remove module1 in the activeworkbook . Any help would be greatly appreciated. Thanks! Kimberly |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing a module with code
Hi Kimberly,
See Chip Pearson's "Deleting A Procedure From A Module" within Programming To The VBE http://www.cpearson.com/excel/vbe.htm You should be able to change ThisWorkbook. to something like Workbooks("BOOK1"). and change the obvious things for module --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "KimberlyC" wrote in message ... Hi Is it possible to remove a module (with code) that is located in another workbook. Here's what I need to do: I would like to run code from an addin file that would remove module1 in the activeworkbook . Any help would be greatly appreciated. Thanks! Kimberly |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unprotect Code Module in Code | Excel Discussion (Misc queries) | |||
Removing Module Protection Programatically | Excel Discussion (Misc queries) | |||
code in module A to not execute a Worksheet_SelectionChange sub of another module | Excel Discussion (Misc queries) | |||
copying vba code to a standard code module | Excel Discussion (Misc queries) | |||
code to add module | Excel Programming |