ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protect with AllowFiltering (https://www.excelbanter.com/excel-programming/357823-protect-allowfiltering.html)

Jérémie Gent

Protect with AllowFiltering
 
Following syntax isn't accepted by Excel:
activesheet.protect allowfiltering:=true
(error 1004)

Wasn't it available in Office 2000 ? If it's the problem, then is there
another way to lock the whole sheet while filter remains enabled ?

Thanks!



Papou

Protect with AllowFiltering
 
Hello
Your code won't work with Excel2000.
Place this code into thisworkbook and amend accordingly:
Private Sub Workbook_Open()
Feuil1.EnableAutoFilter = True 'amend sheet codename
Feuil1.Protect Contents:=True, UserInterfaceOnly:=True 'amend sheetcodename
End Sub

Cordially
Pascal



Jérémie Gent

Protect with AllowFiltering
 
OK, perfect!
This works fine, thanks Pascal!
Doesn't need to be in the Workbook codemodule though, so even better!

Jérémie

"papou" <cestpasbon@çanonplus schrieb im Newsbeitrag
...
Hello
Your code won't work with Excel2000.
Place this code into thisworkbook and amend accordingly:
Private Sub Workbook_Open()
Feuil1.EnableAutoFilter = True 'amend sheet codename
Feuil1.Protect Contents:=True, UserInterfaceOnly:=True 'amend
sheetcodename
End Sub

Cordially
Pascal





Tom Ogilvy

Protect with AllowFiltering
 
Unless something has changed,
If it isn't, then it won't work the next time you open the workbook.

It has to be set each time as it is non-persistent when done this way.

You might want to do some additional testing.

--
Regards,
Tom Ogilvy


"Jérémie Gent" wrote:

OK, perfect!
This works fine, thanks Pascal!
Doesn't need to be in the Workbook codemodule though, so even better!

Jérémie

"papou" <cestpasbon@çanonplus schrieb im Newsbeitrag
...
Hello
Your code won't work with Excel2000.
Place this code into thisworkbook and amend accordingly:
Private Sub Workbook_Open()
Feuil1.EnableAutoFilter = True 'amend sheet codename
Feuil1.Protect Contents:=True, UserInterfaceOnly:=True 'amend
sheetcodename
End Sub

Cordially
Pascal






Jérémie Gent

Protect with AllowFiltering
 
Thanks a lot to both of you, you're right, and I was wrong!

Now everything is working fine!

Best
Jérémie

"Tom Ogilvy" schrieb im Newsbeitrag
...
Unless something has changed,
If it isn't, then it won't work the next time you open the workbook.

It has to be set each time as it is non-persistent when done this way.

You might want to do some additional testing.

--
Regards,
Tom Ogilvy


"Jérémie Gent" wrote:

OK, perfect!
This works fine, thanks Pascal!
Doesn't need to be in the Workbook codemodule though, so even better!

Jérémie

"papou" <cestpasbon@çanonplus schrieb im Newsbeitrag
...
Hello
Your code won't work with Excel2000.
Place this code into thisworkbook and amend accordingly:
Private Sub Workbook_Open()
Feuil1.EnableAutoFilter = True 'amend sheet codename
Feuil1.Protect Contents:=True, UserInterfaceOnly:=True 'amend
sheetcodename
End Sub

Cordially
Pascal









All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com