View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
InsideTGT InsideTGT is offline
external usenet poster
 
Posts: 1
Default Activate fails when someone else is in the sheet

In my workbook open function (shown here), I activate my two tabs and call a
routine to do "ShowAllData" (they both use autofilter). Both sheets are
protected w/password and the workbook itself has a password for opening.

The sheet works fine for the first person that gets in, but when a second
user tries to access the same workbook, they get an "Activate method failed,
error 1004" on the first Activate statement.

The error doesn't occur in all cases, this morning I went into a sheet that
was locked by someone else, but didn't get the error, plus I haven't been
able to recreate it with co-workers. Does anyone have ideas for why this
could happen?

Private Sub Workbook_Open()
Dim MyDate
MyDate = Date
If MyDate #8/1/2005# Then
Worksheets("NonExempt").Activate
Call SetProtect
Worksheets("Exempt").Activate
Call SetProtect
MsgBox ("Autofilter is available in this workbook. Feel free to set
filters to allow viewing/printing of desired subsets of data.")
End If
End Sub