autofilter on a protected sheet

D

Dave Unger

Hello,

I'm running a macro which unprotects a sheet, applies an autofilter,
then protects the sheet again with filtering enabled.

I'm wondering what the difference is between these 2 snippets, they
seem to be equivalent in this instance:

with wk
.EnableAutoFilter = True
.Protect UserInterfaceOnly:=True

versus

.Protect AllowFiltering:=True

Thanks for any insight on this,

regards,

DaveU
 
D

Dave Peterson

Those granular levels of worksheet protection were added in xl2002.

The first code sample may have been written for xl2k or below (or has to support
lots of versions).
 
D

Dave

Simon & Dave, thanks for your respnses, much appreciated.



Those granular levels of worksheet protection were added in xl2002.  

Dave, not quite sure what you mean


The first code sample may have been written for xl2k or below (or has to support
lots of versions).
I'm interpreting that to mean use this on xl2002+ - .Protect
AllowFiltering:=True

regards,

Dave
 
D

Dave Peterson

What version of excel are you using?

If you're using xl2002 or newer, then do Tools|Protection|protect sheet (or
xl2007's equivalent).

Notice all those options in the "allow all users of this worksheet to:" box?
Well, there were only 3 options in xl2k and below--Contents, Objects and
scenarios.

All that fine control (granular, like controlling a grain of sand) was added in
xl2002.

And if you never need to support xl2k or earlier, then that seems ok to me.
 
D

Dave

Sorry Dave, I neglected that bit of info. I'm using xl2007, but
coding for xl2002+

Thanks for your help,

DaveU
 
D

Dave Peterson

There are differences between xl2007 and previous versions.

You may want to do some extensive testing in the earlier versions before
releasing your project.

Or if it's possible, you may want to develop in xl2002. Then the testing should
be simpler in xl2007.
 
D

Dave

Thanks Dave

regards,

DaveU

There are differences between xl2007 and previous versions.

You may want to do some extensive testing in the earlier versions before
releasing your project.

Or if it's possible, you may want to develop in xl2002.  Then the testing should
be simpler in xl2007.







--

Dave Peterson- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top