Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programmatically unprotect my protected project to delete modules?
Ah, Chip's site...thanks. Bummer :-(
-- Toby Erkson http://www.bidata.net/ "Jim Thomlinson" wrote in message ... Nope... You can try using send keys but that is hit and miss... See the first NOTE: in the attached hyperlink... http://www.cpearson.com/excel/vbe.htm -- HTH... Jim Thomlinson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programmatically unprotect my protected project to delete modules?
Maybe it's time to separate your workbook into two pieces--one for the data (a
template workbook maybe???) and one for the code. Then any code that you need in the workbook can be stored in that template workbook. And any code that you need (but not share) can be kept in the addin. Toby Erkson wrote: 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/ -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programmatically unprotect my protected project to delete modules?
Hmm...good thinkin'! :-)
-- Toby Erkson http://www.bidata.net/ "Dave Peterson" wrote in message ... Maybe it's time to separate your workbook into two pieces--one for the data (a template workbook maybe???) and one for the code. Then any code that you need in the workbook can be stored in that template workbook. And any code that you need (but not share) can be kept in the addin. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Programmatically unprotect a VBAProject | Excel Programming | |||
Programmatically delete macro using a protected project | Excel Programming | |||
Assigning the Help 4, *.HLP file for a project programmatically in a protected Project | Excel Programming | |||
Accesing vba project from wb that has vba project password protected | Excel Programming | |||
Delete modules programmatically and save | Excel Programming |