Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default help needed from someone with xl 2000

Hi Don,

To add to JMB's reply, v2002 took a big leap over v2000 by adding the
protection class, and its associated options. Ordinarily, protection options
applied in v2002 and later would be ignored in v2000 as "backward
compatibility" usually provides that. A problem will arise trying to
"programmatically" apply these options if your project is run in v2000 using
the later version options. Here's a sub that encapsulates this issue and some
of the most common non-persistent properties. You can use it for both v2000
and later versions.

Sub wksProtect()
' This lists all the members of the Protection class.
' Move rows around to list desired settings first,
' then comment out the lower (unwanted) settings.

With ActiveSheet
If val(Application.Version) = 10 Then
.Protect Password:=gszPwrd, _
DrawingObjects:=True, _
Contents:=True, _
Scenarios:=True, _
Userinterfaceonly:=True, _
AllowFiltering:=True, _
AllowFormattingColumns:=True, _
AllowFormattingRows:=True, _
AllowDeletingColumns:=True, _
AllowDeletingRows:=True, _
AllowFormattingCells:=True, _
AllowInsertingColumns:=True, _
AllowInsertingRows:=True ', _
AllowInsertingHyperlinks:=True, _
AllowUsingPivotTables:=True
Else
.Protect Password:=gszPwrd, _
DrawingObjects:=True, _
Contents:=True, _
Scenarios:=True, _
Userinterfaceonly:=True 'Non-persistent:This one must be reset (all
versions) when the workbook is re-opened. **Requires unprotecting first**
End If

'Non-persistent settings
'These must be reset when the workbook is re-opened
'UnComment the desired setting only
' .EnableSelection = xlNoRestrictions
.EnableSelection = xlUnlockedCells
' .EnableSelection = xlNoSelection

.EnableAutoFilter = True
' .EnableAutoFilter = False
End With 'ActiveSheet

End Sub

HTH
Regards,
Garry
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
Regexp needed in Excel 2000 Mr. Me Excel Discussion (Misc queries) 14 August 2nd 05 08:01 PM
Hyperlink in Excel 2000 can't open bookmarked Word 2000 file DCheslock Excel Discussion (Misc queries) 1 May 5th 05 10:46 PM
Help needed with textbox formatting in Excel 2000 JIMBROOKS Excel Discussion (Misc queries) 1 January 1st 05 03:33 PM
Create macro to download access 2000 table to excel 2000 spreadsheet Tushar[_2_] Excel Programming 3 October 21st 04 02:44 PM
MS Excel 2000 - Data Delete Help Needed RES Excel Programming 1 December 31st 03 03:34 PM


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