Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Unlock VBE
Is there any new information on how to unlock a VBE Project when you don't
know the password? I've tried Bill Manvilee's code but even though I've got the extensibility checked, I can't even assign that UnprotectVBProject macro to anything (macro doesn't show up on the list of available macros). I can run the "test" macro ok, but it just comes up asking for a password to th NSC.xls VBE. Code used is as follows: Sub test() UnprotectVBProject Workbooks("NSC.xls"), "password" End Sub Sub UnprotectVBProject(WB As Workbook, ByVal Password As String) ' ' Bill Manville, 29-Jan-2000 ' Dim VBP As VBProject, oWin As VBIDE.Window Dim wbActive As Workbook Dim i As Integer Set VBP = WB.VBProject Set wbActive = ActiveWorkbook If VBP.Protection < vbext_pp_locked Then Exit Sub Application.ScreenUpdating = False ' Close any code windows To ensure we hit the right project For Each oWin In VBP.VBE.Windows If InStr(oWin.Caption, "(") 0 Then oWin.Close Next oWin WB.Activate ' now use lovely SendKeys To unprotect Application.OnKey "%{F11}" SendKeys "%{F11}%TE" & Password & "~~%{F11}", True If VBP.Protection = vbext_pp_locked Then ' failed - maybe wrong password SendKeys "%{F11}%TE", True End If ' leave no evidence of the password Password = "" ' go back To the previously active workbook wbActive.Activate End Sub Thanks, Brett |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Unlock VBE
Bill's code relies on you knowing the password.
If you don't know the password, then I wouldn't think this approach would be very effective. Brettjg wrote: Is there any new information on how to unlock a VBE Project when you don't know the password? I've tried Bill Manvilee's code but even though I've got the extensibility checked, I can't even assign that UnprotectVBProject macro to anything (macro doesn't show up on the list of available macros). I can run the "test" macro ok, but it just comes up asking for a password to th NSC.xls VBE. Code used is as follows: Sub test() UnprotectVBProject Workbooks("NSC.xls"), "password" End Sub Sub UnprotectVBProject(WB As Workbook, ByVal Password As String) ' ' Bill Manville, 29-Jan-2000 ' Dim VBP As VBProject, oWin As VBIDE.Window Dim wbActive As Workbook Dim i As Integer Set VBP = WB.VBProject Set wbActive = ActiveWorkbook If VBP.Protection < vbext_pp_locked Then Exit Sub Application.ScreenUpdating = False ' Close any code windows To ensure we hit the right project For Each oWin In VBP.VBE.Windows If InStr(oWin.Caption, "(") 0 Then oWin.Close Next oWin WB.Activate ' now use lovely SendKeys To unprotect Application.OnKey "%{F11}" SendKeys "%{F11}%TE" & Password & "~~%{F11}", True If VBP.Protection = vbext_pp_locked Then ' failed - maybe wrong password SendKeys "%{F11}%TE", True End If ' leave no evidence of the password Password = "" ' go back To the previously active workbook wbActive.Activate End Sub Thanks, Brett -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Unlock VBE
Thanks Dave, bugger it!
"Dave Peterson" wrote: Bill's code relies on you knowing the password. If you don't know the password, then I wouldn't think this approach would be very effective. Brettjg wrote: Is there any new information on how to unlock a VBE Project when you don't know the password? I've tried Bill Manvilee's code but even though I've got the extensibility checked, I can't even assign that UnprotectVBProject macro to anything (macro doesn't show up on the list of available macros). I can run the "test" macro ok, but it just comes up asking for a password to th NSC.xls VBE. Code used is as follows: Sub test() UnprotectVBProject Workbooks("NSC.xls"), "password" End Sub Sub UnprotectVBProject(WB As Workbook, ByVal Password As String) ' ' Bill Manville, 29-Jan-2000 ' Dim VBP As VBProject, oWin As VBIDE.Window Dim wbActive As Workbook Dim i As Integer Set VBP = WB.VBProject Set wbActive = ActiveWorkbook If VBP.Protection < vbext_pp_locked Then Exit Sub Application.ScreenUpdating = False ' Close any code windows To ensure we hit the right project For Each oWin In VBP.VBE.Windows If InStr(oWin.Caption, "(") 0 Then oWin.Close Next oWin WB.Activate ' now use lovely SendKeys To unprotect Application.OnKey "%{F11}" SendKeys "%{F11}%TE" & Password & "~~%{F11}", True If VBP.Protection = vbext_pp_locked Then ' failed - maybe wrong password SendKeys "%{F11}%TE", True End If ' leave no evidence of the password Password = "" ' go back To the previously active workbook wbActive.Activate End Sub Thanks, Brett -- Dave Peterson |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Unlock VBE
Yes, this should be your password :)
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to Unlock | New Users to Excel | |||
Unlock for Viewing | Excel Worksheet Functions | |||
Unlock VBA project | Excel Discussion (Misc queries) | |||
how do i password protect an .xls file? how do i unlock it for automation. e.g. want to unlock and access a .xls from another .xls macro. | Excel Worksheet Functions | |||
How do I unlock a document? | Excel Discussion (Misc queries) |