Print An Excel sheet from acess help

M

Mike

Please!!!!
I just need help on how to select an excel spreadsheet and print sheet1 on
click

Mike
 
A

Arvin Meyer

Mike said:
Please!!!!
I just need help on how to select an excel spreadsheet and print sheet1 on
click

Something like this:

Private Sub PrintXL_Click()

Dim appXL As Excel.Application
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet

Set appXL = New Excel.Application
Set wkb = appXL.Workbooks.Open("C:\Your Excel File.xls")
Set wks = wkb.Worksheets(1)

'appXL.Visible = True

wks.PrintOut 'or wks.PrintPreview only if you use the line above

End Sub

You can pick a worksheet with the code here:

http://www.mvps.org/access/api/api0001.htm
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

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

Top