The following macro works partially...
---------------------------------------
Private Sub Workbook_Open()
On Error GoTo Workbook_Open_Error
If Worksheets("Audit").Range("E2").Value = "New" Then
Worksheets("Audit").Range("A2").Value = Application.UserName
Worksheets("Audit").Range("B2").Value = Date
Worksheets("Audit").Range("C2").Value = Time
Randomize
Worksheets("Audit").Range("D2").Value = Rnd()
....up to here, but the next two lines don't do anything. They are supposed
to protect with a random password, and then hide the sheet....
Worksheets("Audit").Protect Password:="A" & Int(Rnd() * 10000000000#)
Worksheets("Audit").Visible = False
End If
GoTo Workbook_Open_Complete
Workbook_Open_Error:
MsgBox "Error in Workbook_Open"
Workbook_Open_Complete:
End Sub
---------------------------------------
Can someone give me some clues? I'm sure this worked yesterday!
Bookmarks