View Single Post
  #4   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 V

How are you locking the scroll bars? Normally, protecting a sheet does not
affect your ability to scroll using the scrollbars. You can set the
ScrollArea to prevent the user from scrolling the sheet. This is not
connected to sheet protection, though, so even if you unprotect the sheet you
would also have to reset the ScrollArea to "" (blank string) to allow
unlimited scrolling.
--
- K Dales


"Stan The Man" wrote:

I am not sure if this is suppose to be like this but if I protect a sheet and
then use unprotect and protect in the VBA code, I still can not use the
scroll bar correctly.

If I protect the sheet, can the scroll bar still scroll or is it unable to
be changed by using the mouse to change the position?

Thanks.
--
Stan


"K Dales" wrote:

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