ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Activate fails when someone else is in the sheet (https://www.excelbanter.com/excel-programming/338720-activate-fails-when-someone-else-sheet.html)

InsideTGT

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


All times are GMT +1. The time now is 12:15 PM.

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