View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Beth Beth is offline
external usenet poster
 
Posts: 67
Default 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