Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Protect spreadshet, but allow user edit range

I would like to protect my spreadsheet, but allow user a edit range.

I used following code:

Sheets(wsDestination).Select
ActiveSheet.Protection.AllowEditRanges(1).Delete
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.Protection.AllowEditRanges.Add Title:=wsDestination & " Range
", Range:=Range("G12:Q20")

If I have "ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True" first then the code failed on the last line. It makes sense,
because the spreadsheet already protected.

When I tried last line first, it protects all the spreadsheet.
If I do not uses "ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True" code, then the whole spreadsheet does not protect at all.

Are there anything wrong I did?

Any information is great appreciated,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Protect spreadshet, but allow user edit range

This works for me:

ActiveSheet.Protection.AllowEditRanges(1).Delete
ActiveSheet.Protection.AllowEditRanges.Add Title:=wsDestination _
& " Range", Range:=Range("D3:H12")
ActiveSheet.Protect DrawingObjects:=True, Contents:=True _
, Scenarios:=True

What is the value of wsDestination?

Regards
Rowan

"Souris" wrote:

I would like to protect my spreadsheet, but allow user a edit range.

I used following code:

Sheets(wsDestination).Select
ActiveSheet.Protection.AllowEditRanges(1).Delete
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.Protection.AllowEditRanges.Add Title:=wsDestination & " Range
", Range:=Range("G12:Q20")

If I have "ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True" first then the code failed on the last line. It makes sense,
because the spreadsheet already protected.

When I tried last line first, it protects all the spreadsheet.
If I do not uses "ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True" code, then the whole spreadsheet does not protect at all.

Are there anything wrong I did?

Any information is great appreciated,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Protect spreadshet, but allow user edit range

Thanks it works now,

Thanks millions,

"Rowan" wrote:

This works for me:

ActiveSheet.Protection.AllowEditRanges(1).Delete
ActiveSheet.Protection.AllowEditRanges.Add Title:=wsDestination _
& " Range", Range:=Range("D3:H12")
ActiveSheet.Protect DrawingObjects:=True, Contents:=True _
, Scenarios:=True

What is the value of wsDestination?

Regards
Rowan

"Souris" wrote:

I would like to protect my spreadsheet, but allow user a edit range.

I used following code:

Sheets(wsDestination).Select
ActiveSheet.Protection.AllowEditRanges(1).Delete
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.Protection.AllowEditRanges.Add Title:=wsDestination & " Range
", Range:=Range("G12:Q20")

If I have "ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True" first then the code failed on the last line. It makes sense,
because the spreadsheet already protected.

When I tried last line first, it protects all the spreadsheet.
If I do not uses "ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True" code, then the whole spreadsheet does not protect at all.

Are there anything wrong I did?

Any information is great appreciated,

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
how can i protect edit links ? coltheplumb Excel Discussion (Misc queries) 1 August 14th 09 12:40 AM
Protect User from edit Control Toolbox (Design Mode) Chrilee Excel Discussion (Misc queries) 2 March 17th 09 05:56 AM
protect query from edit Daniel Setting up and Configuration of Excel 0 February 15th 08 12:04 PM
Spreadshet Help Aquagirl New Users to Excel 1 February 15th 07 04:10 AM
Protect Macro from Edit Bin[_2_] Excel Programming 2 April 9th 04 12:57 AM


All times are GMT +1. The time now is 11:01 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"