Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Msg Box with Print/Exit option needed

Status
Not open for further replies.

aarondewberry

IS-IT--Management
Jul 20, 2005
148
GB
All

I have an excel spreadsheet that, when opened a msg box appears asking the user to push print and exit the spreadsheet.

What I want to do is to be able to put two buttons on the msg box. A print button (to replace the standard 'Ok' button) aswell as an exit button, so that the user will never have to fully enter the spreadsheet.

Hope this is clear!?

Please see below the current code am using....

Private Sub Workbook_Open()
MsgBox "Please print document using the print icon" & vbCrLf & _
"Once printed, please exit the spreadsheet"
End Sub

Thanks
 
Something like this (typed, untested) ?
Private Sub Workbook_Open()
If MsgBox("Print document", vbOKCancel, "Print document") = vbOK Then
ThisWorkbook.PrintOut
End If
ThisWorkbook.Close False
End Sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top