-
Sub only works when stepping in to
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?
[VBA]Sub refresh()
Dim ws As Worksheet
Set ws = ActiveSheet
ws.Unprotect Password:="itsc"
ActiveWorkbook.RefreshAll
ws.Protect Password:="itsc"
End Sub[/VBA]
-
I created a workbook & set the password as you have
so sheet 1 was protected then pressed F8 to debug, it unprotected the sheet, carried out the refresh then reset the sheet password again.
All worked ok for me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules