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: 32
Default Programmatically unprotect my protected project to delete modules?

I have set the "Lock project for viewing" in my Project Properties. Just to
keep away casual prying eyes. There is a section in on of my modules where
I delete other modules (but not the one where the code is running):

With ActiveWorkbook.VBProject
'Remove modules from wkbk
.VBComponents.Remove .VBComponents("UpdateKPIdatasets")
.VBComponents.Remove .VBComponents("zSupport")
.VBComponents.Remove .VBComponents("RegExps")
.VBComponents.Remove .VBComponents("UserForm1") 'Remove form from wkbk
End With

I get an error with the first .Remove and everything stops because the
project is protected. Okay, that's to be expected, so is there a way I can
programmatically Unprotect the project? The code does work if I unprotect
my project.
--
Toby Erkson
http://www.bidata.net/


 
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
Programmatically unprotect a VBAProject Frederick Chow Excel Programming 3 March 22nd 06 08:12 AM
Programmatically delete macro using a protected project John Cole, Jr. Excel Programming 1 November 14th 04 04:22 PM
Assigning the Help 4, *.HLP file for a project programmatically in a protected Project Tony Seiscons Excel Programming 0 October 4th 04 03:10 PM
Accesing vba project from wb that has vba project password protected cassidyr1 Excel Programming 2 July 3rd 04 01:49 PM
Delete modules programmatically and save Brijesh Shah Excel Programming 3 December 24th 03 08:14 PM


All times are GMT +1. The time now is 01:19 PM.

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

About Us

"It's about Microsoft Excel"