ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unprotect a Excel workbook using vba macro (https://www.excelbanter.com/excel-programming/327026-unprotect-excel-workbook-using-vba-macro.html)

Vj

Unprotect a Excel workbook using vba macro
 
Is there any way, I can unprotect a excel workbook using vba macro.

Thanx

Jim Thomlinson[_3_]

Unprotect a Excel workbook using vba macro
 
Activeworkbook.unprotect "MyPassword"

HTH

"VJ" wrote:

Is there any way, I can unprotect a excel workbook using vba macro.

Thanx


Vj

Unprotect a Excel workbook using vba macro
 
Hi Jim,

I am sorry, It is about locking and unlocking a workbook using vba macro.

Thanks for ur help

"Jim Thomlinson" wrote:

Activeworkbook.unprotect "MyPassword"

HTH

"VJ" wrote:

Is there any way, I can unprotect a excel workbook using vba macro.

Thanx


Beth

Unprotect a Excel workbook using vba macro
 
'If document is protected, Unprotect it.
If ActiveDocument.ProtectionType < wdNoProtection Then
ActiveDocument.Unprotect Password:=""
End If

'ReProtect the document.
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
End If

One unprotects then one protects

"VJ" wrote:

Is there any way, I can unprotect a excel workbook using vba macro.

Thanx



All times are GMT +1. The time now is 04:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com