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

Please go to VBA help file and look up the Protect Method as it applies to
a Worksheet object. In xl 2002 this has been expanded. We don't have an xl
2000 around here to know just what was added.

We use these arguments: DrawingObjects, Contents, UserInterfaceOnly,
AllowFormattingCells, AllowFiltering. Do any of these exist in xl 2000?

Thanks, Don <www.donwiss.com (e-mail link at home page bottom).
  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default help needed from someone with xl 2000

AllowFormatting and AllowFiltering appear to be new to the protect method.
From the help file:

expression.Protect(Password, DrawingObjects, Contents, Scenarios,
UserInterfaceOnly)

There is a property to enable the autofilter. I've only used it once
before. I don't think it is persistent in that when the workbook is saved,
closed, and reopened it has to be reset. I think I used a Workbook_Open
event handler to set it each time the workbook was opened. Also, it only
works when UserInterFaceOnly is activated.

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


"Don Wiss" wrote:

Please go to VBA help file and look up the Protect Method as it applies to
a Worksheet object. In xl 2002 this has been expanded. We don't have an xl
2000 around here to know just what was added.

We use these arguments: DrawingObjects, Contents, UserInterfaceOnly,
AllowFormattingCells, AllowFiltering. Do any of these exist in xl 2000?

Thanks, Don <www.donwiss.com (e-mail link at home page bottom).

  #3   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 12:37 AM.

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"