View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default Protect a Worksheet

The query will refresh as you say upon opening. Choices

1. Set the query to load manually, then in the workbook open event unprotect
sheet, run query and then re-protect the sheet

2. Leave query to refresh but before saving/closing(and save) the workbook
unprotect the sheet, then after the query has run re-protect the sheet

Personally I would use the first option, as you have more control.



--

Regards,
Nigel




"Otter" wrote in message
...
I have a worksheet that has a parameter query that was set up through the
Import External Data option. It is set to refresh on open and it errors
out
if I protect the worksheet and save it. I have tried protecting the
worksheet
with code but can't seem to find the correct place to put the code. I
tried
it in "This Workbook" but it protects it before the query runs and does
the
update. I have put the protect in the begining of the worksheet that I
want
to protect but it does not protect it. Any ideas?