![]() |
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 |
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 |
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 |
All times are GMT +1. The time now is 10:21 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com