Open, print and close workbook

  • Thread starter Thread starter despistado
  • Start date Start date
D

despistado

It is possible to open, print and close a workbook passing the name o
the .xls like a parameter?

Thank you
 
despistado

It depend what you mean by as a parameter.

You could set the workbook up with a Workbook_Open() event. This fires when
the workbook is opened. You could then have the workbook opened by a
command line or scheduled task. The workbook_Open() event code could look
like this

Private Sub Workbook_Open()
With Me
.PrintOut
.Close SaveChanges:=False
End With
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top