LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using VBA to Protect sheet(s) with Autofilter


Hi!

I'm using this commands in VBA (Excel 2000):

Sub Auto_Open()
With Worksheets("Sheet1")
.Protect Password:="pass", userinterfaceonly:=True
.EnableAutoFilter = True
End With

End Sub


....to use autofilter when the sheet1 is protected. I also created th
same VBA commands to do the same in sheet2:

Sub Auto_Open()
With Worksheets("Sheet2")
.Protect Password:="pass", userinterfaceonly:=True
.EnableAutoFilter = True
End With

End Sub


It works fine until I close and reopen this workbook. Then there is a
error message "Ambiguous name detected: Auto_Open"

It works fine with only sheet1 protected, but not with two or more??

What can be the problem

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

 
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
Utilizng full AutoFilter features while specific cells are protect Travis Excel Discussion (Misc queries) 0 April 10th 09 12:59 AM
Utilizng full AutoFilter features while specific cells are protect Travis Excel Worksheet Functions 0 April 10th 09 12:58 AM
Utilizng full AutoFilter features while specific cells are protect Travis Excel Discussion (Misc queries) 0 April 10th 09 12:53 AM
How to protect formula's, but allow autofilter MichaelJDrake Excel Worksheet Functions 1 February 24th 06 02:53 PM
how do i protect an Autofilter funtion on Excel 2000 Sincy Excel Worksheet Functions 1 June 17th 05 11:41 AM


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