Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://excel-egy.com/forum/t3834
- ---------------------------------
- Sub Test_EnableDisableProtection()
- Dim myLink As Variant
- EnableDisableProtection False
- Application.AskToUpdateLinks = False
- For Each myLink In ActiveWorkbook.LinkSources(xlExcelLinks)
- ActiveWorkbook.UpdateLink Name:=myLink, Type:=xlExcelLinks
- Next myLink
- Application.AskToUpdateLinks = True
- EnableDisableProtection True
- End Sub
- Sub EnableDisableProtection(b As Boolean)
- Dim ws As Worksheet
- For Each ws In ThisWorkbook.Worksheets
- If b Then
- ws.Protect "123"
- Else
- ws.Unprotect "123"
- End If
- Next ws
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement