ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet Protection Question (https://www.excelbanter.com/excel-programming/409614-worksheet-protection-question.html)

Jack

Worksheet Protection Question
 
I'd like to protect a worksheet so that all Locked cells are unselectable yet
the user will have the ability to insert a picture when an unlocked cell is
selected. Basically, the top 12 rows are locked and the remaining cells are
unlocked.

Using the following:

ActiveSheet.Protect Password:=MyPassword, Contents:=True,
DrawingObjects:=False, UserInterfaceOnly:=True

does exacly what I need when running in Excel 2007.

However, the same code in Excel 2003 & 2002 doesn't allow for inserting a
picture via the Insert Picture From File command. I've tried every
possibility I could think of for the Protect method, however, it is not until
I set Contents:=False that I find the Insert Picture From File is enabled. Of
course at this point, all the Locked cells are now essentially unlocked.

My current solution is to set Contents to True for Excel 2007 and to False
for all earlier versions. Needlesstosay, I'd like to find a better solution.

Any suggestions?

Thanks!
--
Jack Waller
<<

MWhaley

Worksheet Protection Question
 
When you in the worksheet and you select protect worksheet, their is a list
of options that will allow the user to do or not to do, select edit objects
or any of the other ones that you desire. Hope this works for you

"Jack" wrote:

I'd like to protect a worksheet so that all Locked cells are unselectable yet
the user will have the ability to insert a picture when an unlocked cell is
selected. Basically, the top 12 rows are locked and the remaining cells are
unlocked.

Using the following:

ActiveSheet.Protect Password:=MyPassword, Contents:=True,
DrawingObjects:=False, UserInterfaceOnly:=True

does exacly what I need when running in Excel 2007.

However, the same code in Excel 2003 & 2002 doesn't allow for inserting a
picture via the Insert Picture From File command. I've tried every
possibility I could think of for the Protect method, however, it is not until
I set Contents:=False that I find the Insert Picture From File is enabled. Of
course at this point, all the Locked cells are now essentially unlocked.

My current solution is to set Contents to True for Excel 2007 and to False
for all earlier versions. Needlesstosay, I'd like to find a better solution.

Any suggestions?

Thanks!
--
Jack Waller
<<



All times are GMT +1. The time now is 08:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com