Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run module ON OPEN event??
I'm trying to create a subroutine that runs as soon as anyone opens my network spreadsheet. I can get it to work if I run it as a macro, but I cannot get it to run ON OPEN. Here's my code:
Private Sub APP_Workbook_Open(ByVal WB As Workbook) USER = Application.UserName USER = UCase(USER) Workbooks("xxxx.xls").HasRoutingSlip = True With Workbooks("xxxx.xls").RoutingSlip .Delivery = xlOneAfterAnother .Recipients = "MG" .Subject = "SPREADSHEET BEING ALTERED" .Message = USER & "<-- " & "Has Altered The Attached Workbook" End With Workbooks("xxxx.xls").Route End Sub I've changed the name of the workbook to xxxx for this message. Any help would be greatly appreciated. Thanks, Mike G. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run module ON OPEN event??
Hi Mike,
Why not put the code into the "Workbooks" section and use the Workbook_Open event? ------------------------------------------------- Private Sub Workbook_Open() ' Paste your code here, replacing "Workbooks("xxxx.xls")." with "ThisWorkbook" End Sub ------------------------------------------------- SuperJas. ----- MG wrote: ----- I'm trying to create a subroutine that runs as soon as anyone opens my network spreadsheet. I can get it to work if I run it as a macro, but I cannot get it to run ON OPEN. Here's my code: Private Sub APP_Workbook_Open(ByVal WB As Workbook) USER = Application.UserName USER = UCase(USER) Workbooks("xxxx.xls").HasRoutingSlip = True With Workbooks("xxxx.xls").RoutingSlip .Delivery = xlOneAfterAnother .Recipients = "MG" .Subject = "SPREADSHEET BEING ALTERED" .Message = USER & "<-- " & "Has Altered The Attached Workbook" End With Workbooks("xxxx.xls").Route End Sub I've changed the name of the workbook to xxxx for this message. Any help would be greatly appreciated. Thanks, Mike G. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
When i open excel, i i get: Compile error in hidden Module, HELP! | Excel Discussion (Misc queries) | |||
Open Event | Excel Discussion (Misc queries) | |||
Event: open workbook | Excel Discussion (Misc queries) | |||
Where?Worksheet code module or Worksheet_SelectionChange event han | Excel Worksheet Functions | |||
Open a XLS from a Module | Excel Programming |