View Single Post
  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

You did put it in the ThisWorkbook code module, not a standard code module?

--
HTH

Bob Phillips

"Cameron Young" wrote in message
...
Hi Bob,

Actually, all of it. For some reason the Workbook_Open() event just

doesn't
seem to fire.
--
Cheers,
Cameron


"Bob Phillips" wrote:

Which bit doesn't work?

--
HTH

Bob Phillips

"Cameron Young" wrote in

message
...
Hi all,

Have whipped the following code in Excel/VBA and placed in the
'ThisWorkbook' module. The problem that I have is that it works well

with
other users using Excel 2003 Standard edition.
I'm using Beginners edition - is that why the code won't run?

The vba code:
[-- code start --]
Private Sub Workbook_Open()

'Prompt user on opening XLS to Print Worksheet and quit.

Dim Resp

Resp = MsgBox("Do you wish to Print and Exit ?", _
vbYesNo + vbQuestion, _
"Print & Exit ?")

If Resp = vbYes Then
ActiveWorkbook.PrintOut
Application.Quit
End If

End Sub
[-- code end --]

Please help - this is driving me nuts.
--
Cheers,
Cameron