Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I had to do some digging recently to try and find the answer to this,
and while I did find a couple good leads, the code wasn't *quite* right. So, for the benefit of someone else trying to attempt to do this crazy thing, I thought I'd post the code here. (Really, it's NOT an ego thing...just trying to give back a little.) NOTE: The constant "conPW " is the password to be used on the project. The value is stored with the project at save/close, so locking the doors when you leave isn't necessary. Public Sub UnprotectVBAProject() 'This has been tested in E97 only. On Error GoTo ErrHandler Const conPW as String = "MyPassword" 'Open VBE Call SendKeys("%{F11}", True) 'Open Project Explorer Call SendKeys("%(V)P", True) 'PageUp 5 times to be sure "VBAProject" is selected Call SendKeys("{PGUP 5}", True) 'Hit Enter to give prompt, enter PW and Enter again. Call SendKeys("{ENTER}" & conPW & "{ENTER}", True) ExitProcedu Exit Sub ErrHandler: Select Case Err.Number Case Else Application.ScreenUpdating = True MsgBox Err.Number & vbNewLine & Err.Description, vbCritical Resume ExitProcedure Resume End Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excell error "Can't find Project or Library" Project VBAProject | Excel Worksheet Functions | |||
How to convert MS Project to MS Excel. I don't have MS Project. | Excel Discussion (Misc queries) | |||
Unprotecting! | Excel Programming | |||
Unprotecting! | Excel Programming | |||
Accesing vba project from wb that has vba project password protected | Excel Programming |