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: 40
Default Help with Workbook_Open macro please

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!
 
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
Workbook_Open macro not running mrice Excel Discussion (Misc queries) 2 April 26th 06 06:45 PM
Disable Workbook_Open() Macro Dan Excel Programming 2 October 13th 04 07:52 PM
Prevent Workbook_Open macro big t Excel Programming 2 August 20th 04 12:01 PM
Workbook_Open & Macro James Cox[_2_] Excel Programming 0 July 2nd 04 03:44 PM
Workbook_Open macro created in Excel 97 problems on MAC Dick Kusleika Excel Programming 2 September 8th 03 06:42 PM


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

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"