View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Locking components BUT Still allowing to change settings via VBA

When you have protected a sheet or workbook, not even VBA can change it. But
the solution is easy: have your code unprotect the sheet, make the changes,
and then reprotect it immediately:

Sheets("MyWorksheet").Unprotect
' Code here to work with sheet/change cell values
Sheets("MyWorksheet").Protect

--
- K Dales


"Stan The Man" wrote:

Hi. I am relatively new but I am trying to lock/protect scroll bars etc
which I can do. However, I have code in VBA which I want to set the Max and
Min etc but which does not work (error will occur) after the sheet is
protected.

I also can not set any specific cells sometimes also. Am not quite sure
what I can do. I want it that it CAN NOT MOVE and also can not change scroll
max and min but only through VBA once all sheets are protected.

Thanks in advance!

--
Stan