Im trying to figure out a way to bypass the unprotect sheet in a shared work book, this is what i came up with so far. any help would be appreciated
Sub Refresh_under_100()
On Error GoTo BadChange
Application.EnableEvents = False
Application.DisplayAlerts = False
ActiveWorkbook.UnprotectSharing sharingpassword:="456789"
ActiveSheet.Unprotect Password:="12345"
Application.ScreenUpdating = False
Sheets("under 100").UsedRange.ClearContents
With Sheets("Fall14").Range("A1").CurrentRegion
.AutoFilter Field:=38, Criteria1:="<=100", Criteria2:=">0"
.EntireRow.Copy Destination:=Sheets("under 100").Range("A1")
.AutoFilter
End With
Application.ScreenUpdating = True
Worksheets("Fall14").protect DrawingObjects:=False, Contents:=True, Scenarios:= _
True, AllowFormattingCells:=True, AllowInsertingRows:=True, AllowSorting _
:=True, Password:="12345"
Worksheets("Fall14").ProtectSharing Filename:=strFilePathName, sharingpassword:="456789"
Application.DisplayAlerts = True
End Sub
Bookmarks