Hi Alokeswar,
Your attachment has the VBA protected with a password.
Regards - Dave.

Date: Fri, 5 Jun 2009 18:37:58 -0700
From: alokeshwar.tiw...@yahoo.com
Subject: $$Excel-Macros$$ Re: remove module
To: excel-macros@googlegroups.com



You can use SendKeys to protect and unprotect VBA project. See attached. I had 
used this to create a macro to delete all modules. 

_________________________________________________________________________________________________
"There are known knowns. These are things we know that we know. There are known 
unknowns. That is to say, there are things that we know we don't know. But 
there are also unknown unknowns. There are things we don't know we don't know."






From: Chris Spicer <chris.spi...@technicana.com>
To: MS EXCEL AND VBA MACROS <excel-macros@googlegroups.com>
Sent: Friday, 5 June, 2009 5:07:56 PM
Subject: $$Excel-Macros$$ Re: remove module


Hi Mike,

I normally like to answer people's questions directly, rather than
offer suggestions, but I'm not sure whether what you're trying to
achieve is possible.

Perhaps an alternative would be to move your proprietary code from
module 2 into a separate xla add-in?  That way module 1 can still make
calls to your code, but you don't need to distribute the add-in.  The
project containing module 1 can be unprotected, but the add-in
containing module 2 can be protected.

If splitting your code like this
 is acceptable, the only other thing I
can see you having to watch out for is a dangling reference to the xla
addin... you should be able to remove that reference programmatically
when it comes time to distribute your workbook.

I hope this helps,

Chris Spicer
www.Technicana.com



On Jun 4, 8:08 pm, mikeallen7 <mikealle...@gmail.com> wrote:
> 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



       Explore and discover exciting holidays and getaways with Yahoo! India 
Travel  Click here!





_________________________________________________________________
View photos of singles in your area Click Here
http://dating.ninemsn.com.au/search/search.aspx?exec=go&tp=q&gc=2&tr=1&lage=18&uage=55&cl=14&sl=0&dist=50&po=1&do=2&trackingid=1046138&r2s=1&_t=773166090&_r=WLM_EndText
--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Reply via email to