Macro to Filter>ShowAll on Protected workbook

G

Guest

I have a protected and shared workbook with data filters enabled. Often
users will exit the workbook and leave their data-filter choices ... making
it difficult for the next user.

I recorded a show-all macro that runs on a button but it gives a VB error
(something like) "that feature is not allowed on a protected workbook".

Any ideas how I can get around this limitation? Thanks.
 
G

Guest

Hi Jimbo -

Try unprotecting the sheet before the "showall" method statement. Then
reprotect:

ActiveSheet.Unprotect
ActiveSheet.ShowAllData
ActiveSheet.Protect AllowFiltering:=True

Note that you may have to provide the protect and unprotect statements with
passwords or other settings as needed.
 
G

Guest

I can't unprotect the worksheet without first un-sharing it ... and I don't
want the macro to kick-off other users.
 
G

Guest

Can't help you then. I haven't yet worked in a shared environment. Sorry.
Somebody else will have to pick up on this thread.

I will research this, but it will take me a while so I'm going to bow out.

Good luck Jimbo,
 

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