LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default remove module via code

I have 2 vba modules that are both within a protected project. I wish
to remove one module via code from the other module. I have this in
"module1":

ThisWorkbook.VBProject.vbcomponents.Remove
ThisWorkbook.VBProject.vbcomponents("module2")

It works fine IF I have the project unprotected, but the problem
arises when the project is protected. I get:

Run-time error '50289': Can't perform operation since the project is
protected.

Someone suggested once to go to Tools--Macros--Security--Trusted
Publishers--Trust access to Visual Basic project (click box). I have
this done, but still does not work when protected. I must have
project protected because others will be using this file and I do not
want them to have access to the sensitive code in 'module2'. The
users will need 'module2' initially to run program, then they will be
converting the program into an output-only file w/ no 'module2'.

Thanks
 
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
Remove Protected Macro Code from Excel Module TGV[_2_] Excel Discussion (Misc queries) 4 August 24th 09 04:10 PM
VBA code in one Module referencing Public Variables Declared inanother Module failing Khurram Excel Programming 5 March 11th 09 11:01 PM
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
Remove the module dayanand108[_5_] Excel Programming 2 September 26th 05 09:11 AM
Run worksheet module code from workbook module? keithb Excel Programming 1 August 14th 05 04:04 AM


All times are GMT +1. The time now is 02:25 AM.

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"