Delete user list : User Access « Access « VBA / Excel / Access / Word






Delete user list

 

Sub DeleteUserList()
    Dim ws As Worksheet, ual As UserAccessList, aer As AllowEditRange, _
      usr As UserAccess
    Set ws = ThisWorkbook.Sheets("Protection")
    ws.Unprotect "Excel2003"
    Set aer = ws.Protection.AllowEditRanges("Edit Range")
    Set ual = aer.Users
    ual.DeleteAll
    ws.Protect "Excel2003"
End Sub

 








Related examples in the same category

1.Add Edit Range
2.Remove Edit Ranges
3.Show Edit Ranges
4.Unlock Edit Range
5.Build user list