View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Yazan Barakat[_2_] Yazan Barakat[_2_] is offline
external usenet poster
 
Posts: 2
Default Excel sheet protection

gives run time error if a password already exists, if not it creats a new
password that i do not know

"Mike" wrote:

This way you could use a password
Sub refreshwithpassword()
Application.ScreenUpdating = False
Sheet1.Unprotect "Password"
ActiveWorkbook.RefreshAll
Sheet1.Protect "Password"
Application.ScreenUpdating = True
End Sub


"Yazan Barakat" wrote:

i have an excel sheet that contains a pivot table that i would like to
protect to avoid selecting locked cells but when i do so i can not refresh
the data of the pivot table!!!
What shall i do