jmenche
03-11-2011, 08:53 AM
Riddle me this.  This sub ONLY works when I put a stop on the unprotect line and F8 my way through.  If I run it normally...the ultimate goal...it gives me a "cell is protected..." error as if the refresh command fired before the unprotect command had a chance to do it's thing.
 
Can anyone explain?
 
:beerchug:
 
Sub refresh()
Dim ws As Worksheet
Set ws = ActiveSheet
    
ws.Unprotect Password:="itsc"
ActiveWorkbook.RefreshAll
ws.Protect Password:="itsc"
    
End Sub
Can anyone explain?
:beerchug:
Sub refresh()
Dim ws As Worksheet
Set ws = ActiveSheet
ws.Unprotect Password:="itsc"
ActiveWorkbook.RefreshAll
ws.Protect Password:="itsc"
End Sub