Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unprotect Code Module in Code Damien Excel Discussion (Misc queries) 2 April 18th 06 03:10 PM
Removing Module Protection Programatically Adam Excel Discussion (Misc queries) 8 April 17th 06 05:46 AM
code in module A to not execute a Worksheet_SelectionChange sub of another module Jack Sons Excel Discussion (Misc queries) 4 December 11th 05 11:52 PM
copying vba code to a standard code module 1vagrowr Excel Discussion (Misc queries) 2 November 23rd 05 04:00 PM
code to add module Herb[_5_] Excel Programming 2 September 19th 03 04:05 PM


All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"