#1   Report Post  
Posted to microsoft.public.excel.misc
flow23
 
Posts: n/a
Default RePost: Protect

I want to protect all the worksheets
however leave the pivot tables for Filtering

+ I have excel 2000.

Is it still possible?


  #2   Report Post  
Posted to microsoft.public.excel.misc
Tom Ogilvy
 
Posts: n/a
Default RePost: Protect

Assuming the Pivot Tables are already in place, you can use the
workbook_Open event to set the EnablePivotTable property to true. You would
also need to set UserInterFaceOnly to true for the protect method.

From the help on EnablePivotTable

-----------------------------------------------

ActiveSheet.EnableOutlining = True
ActiveSheet.Protect contents:=True, userInterfaceOnly:=True

----------------------------------------------

so you would do something like

Private Sub Workbook_Open
Dim sh as Worksheet, sh1 as Worksheet
set sh1 = ActiveSheet
for each sh in Thisworkbook.Worksheets
sh.Select
sh.EnablePivotTable = True
sh.Protect Contents:=True, UserInterfaceOnly:=True
Next
sh1.Activate
End Sub

Use the workbook_Open Event

See Chip Pearson's page on Events if not familiar
http://www.cpearson.com/excel/events.htm

See this article for additional info (pertinent to xl2000 as well)

http://support.microsoft.com/kb/169106/en-us

--
Regards,
Tom Ogilvy



"flow23" wrote in message
...
I want to protect all the worksheets
however leave the pivot tables for Filtering

+ I have excel 2000.

Is it still possible?




  #3   Report Post  
Posted to microsoft.public.excel.misc
flow23
 
Posts: n/a
Default RePost: Protect

Thanks

Its works fine.. except when it selects the last sheet . an error occurs

" Run time error 1004
: Method "select of object_worksheet failed"

Any ideas why?



"Tom Ogilvy" wrote:

Assuming the Pivot Tables are already in place, you can use the
workbook_Open event to set the EnablePivotTable property to true. You would
also need to set UserInterFaceOnly to true for the protect method.

From the help on EnablePivotTable

-----------------------------------------------

ActiveSheet.EnableOutlining = True
ActiveSheet.Protect contents:=True, userInterfaceOnly:=True

----------------------------------------------

so you would do something like

Private Sub Workbook_Open
Dim sh as Worksheet, sh1 as Worksheet
set sh1 = ActiveSheet
for each sh in Thisworkbook.Worksheets
sh.Select
sh.EnablePivotTable = True
sh.Protect Contents:=True, UserInterfaceOnly:=True
Next
sh1.Activate
End Sub

Use the workbook_Open Event

See Chip Pearson's page on Events if not familiar
http://www.cpearson.com/excel/events.htm

See this article for additional info (pertinent to xl2000 as well)

http://support.microsoft.com/kb/169106/en-us

--
Regards,
Tom Ogilvy



"flow23" wrote in message
...
I want to protect all the worksheets
however leave the pivot tables for Filtering

+ I have excel 2000.

Is it still possible?





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
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
How to protect and unprotect 30 worksheets in a file every month . Protect & Unprotect Several Worksheets Excel Worksheet Functions 4 January 10th 05 01:29 PM
Can I protect a spreadsheet from being deleted or moved? Dean Excel Discussion (Misc queries) 2 January 7th 05 02:27 AM
How to protect Option button in worksheet Julie Excel Worksheet Functions 2 January 4th 05 01:01 AM
Password protect cells PivotTable & allow the Pivot Table to refre KJThams Excel Worksheet Functions 2 November 30th 04 04:13 AM


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

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

About Us

"It's about Microsoft Excel"