Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Knowing is a workbook's VBA project has password or not
Is there a way to know (using VBA code) if a workbook's VBA project is
password protected? In other words, I want to be able to know if the workbook's macros are running on a password protected or un-protected VBA Poject? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Knowing is a workbook's VBA project has password or not
Dim wkbk As Workbook
Set wkbk = Workbooks("yourworkbooknamehere.xls") If wkbk.VBProject.Protection = vbext_pp_locked Then MsgBox "it's locked" Else MsgBox "It's not" End If ========== I _think_ that this was added in xl2k. But you'll want to test it in all the versions of excel that you're supporting. OMER wrote: Is there a way to know (using VBA code) if a workbook's VBA project is password protected? In other words, I want to be able to know if the workbook's macros are running on a password protected or un-protected VBA Poject? -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Knowing is a workbook's VBA project has password or not
Thank You Dave. It worked.
I changed vbext_pp_locked to 1 because the reference to VB extensibility is not set. "Dave Peterson" wrote: Dim wkbk As Workbook Set wkbk = Workbooks("yourworkbooknamehere.xls") If wkbk.VBProject.Protection = vbext_pp_locked Then MsgBox "it's locked" Else MsgBox "It's not" End If ========== I _think_ that this was added in xl2k. But you'll want to test it in all the versions of excel that you're supporting. OMER wrote: Is there a way to know (using VBA code) if a workbook's VBA project is password protected? In other words, I want to be able to know if the workbook's macros are running on a password protected or un-protected VBA Poject? -- Dave Peterson . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA Project Password | Excel Programming | |||
Project password | Excel Programming | |||
I need to remove a password on our timesheet without knowing the p | Excel Discussion (Misc queries) | |||
VBA Project Password | Excel Programming | |||
Accesing vba project from wb that has vba project password protected | Excel Programming |