View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Deeds[_2_] Deeds[_2_] is offline
external usenet poster
 
Posts: 4
Default Run Query, then Protect Spreadsheet

Don
I am having the same problem...I used your code, but when I try to "refresh data" it gives me the error that the sheet is protected and cannot refresh. Any ideas

----- Don wrote: ----

Don't know if you solved this,bu

Sub Auto_Open(
With ThisWorkbook.Sheets("SHeet1"
.Protect UserInterfaceOnly:=Tru
End Wit
End Su

Then your macros will be able to modify everything, but the users will not, and you won't need to unlock and relock the sheet

Don