Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Locking from data entry but allowing oulining to function? saharafrog Excel Discussion (Misc queries) 1 March 26th 10 08:29 PM
Locking a spreadsheet, yet allowing sort WashtenawWeddings.com New Users to Excel 1 February 12th 09 05:54 PM
Locking a spreadsheet and allowing hyperlinks and sort WashtenawWeddings.com[_2_] New Users to Excel 0 February 12th 09 04:07 PM
Locking a worksheet, but allowing user to add rows in a table Ray Carter Excel Worksheet Functions 2 September 24th 08 11:51 PM
locking text in a cell, but allowing new text to be added Hell-fire New Users to Excel 2 June 12th 07 03:47 PM


All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"