Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default unprotecting modules

I have my VBAproject protected from viewing my code. I want to write a
macro that will unprotect it so I can delete some other modules. I have
tried:

sub unprotectproject()
ThisWorkbook.VBProject.vbcomponents.Unprotect Password:="ok"
end sub

it doesn't work, though. anyone know the answer? Thanks, Mike Allen


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default unprotecting modules

Unless you have some method to replace the password in the closed file
(which is what the crackers do) the only way (AFAIK) is with SendKeys.
Search "Unlock VBAProject SendKeys" in this ng.

Regards,
Peter T


"mike allen" wrote in message
...
I have my VBAproject protected from viewing my code. I want to write a
macro that will unprotect it so I can delete some other modules. I have
tried:

sub unprotectproject()
ThisWorkbook.VBProject.vbcomponents.Unprotect Password:="ok"
end sub

it doesn't work, though. anyone know the answer? Thanks, Mike Allen




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default unprotecting modules

I wasn't thinking, even if you could replace the password in the closed file
it'd still be locked. I doubt you'd want to use the unreliable SendKeys
approach and risk exposing your project.

Peter T

"Peter T" <peter_t@discussions wrote in message
...
Unless you have some method to replace the password in the closed file
(which is what the crackers do) the only way (AFAIK) is with SendKeys.
Search "Unlock VBAProject SendKeys" in this ng.

Regards,
Peter T


"mike allen" wrote in message
...
I have my VBAproject protected from viewing my code. I want to write a
macro that will unprotect it so I can delete some other modules. I have
tried:

sub unprotectproject()
ThisWorkbook.VBProject.vbcomponents.Unprotect Password:="ok"
end sub

it doesn't work, though. anyone know the answer? Thanks, Mike Allen






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default unprotecting modules

The solution I'd recommend is to store proprietary code and worksheets
in an Excel Add-In.

Alternatively you could import your VBA modules on start up and export
them on exiting.

See : http://www.cpearson.com/excel/vbe.htm for tips on importing and
exporting modules.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default unprotecting modules

what i was planning was to have one module contain code that deletes other
modules that contain valuable code. though protected, code can certainly be
run, as i do this all the time. if i could unprotect the modules while
running this code, i could then delete the other modules (i have the code
for this) and have just the output void of the valuable code. of course, i
would save it as something else. i can certainly unprotect sheets, so it
seems like modules would be available, too. sheets("sheet1").unprotect
password:="ok"

i'll look into the Add-In and export/import as suggested. thanks, mike
allen
wrote in message
oups.com...
The solution I'd recommend is to store proprietary code and worksheets
in an Excel Add-In.

Alternatively you could import your VBA modules on start up and export
them on exiting.

See : http://www.cpearson.com/excel/vbe.htm for tips on importing and
exporting modules.



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
Public, Private, Event modules, Forms modules,,, Jim May Excel Programming 11 October 31st 05 03:12 AM
Basic question - modules and class modules - what's the difference? Mark Stephens[_3_] Excel Programming 9 May 8th 05 11:48 AM
When to code in sheet or userform modules and when to use modules Tony James Excel Programming 1 December 16th 04 10:02 PM
Unprotecting! Joseph Excel Programming 1 August 2nd 04 04:18 PM
Class Modules vs Modules Jeff Marshall Excel Programming 2 September 28th 03 07:57 PM


All times are GMT +1. The time now is 01:58 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"