Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locking components BUT Still allowing to change settings via VBA
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locking components BUT Still allowing to change settings via V
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Locking from data entry but allowing oulining to function? | Excel Discussion (Misc queries) | |||
Locking a spreadsheet, yet allowing sort | New Users to Excel | |||
Locking a spreadsheet and allowing hyperlinks and sort | New Users to Excel | |||
Locking a worksheet, but allowing user to add rows in a table | Excel Worksheet Functions | |||
locking text in a cell, but allowing new text to be added | New Users to Excel |