PRINT A SPECIFIC EXCEL DOCUMENT

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi-
I would like to make a command button on a access form print a excel
spreadsheet. It will be the same spreadsheet every time. the file path to
the spread sheet is:

"S:\Production Engineering\SACRAMENTO RAW MATERIAL COUNTS\ACCESS RAW
MATERIALS\BAR COUNT BLANK.xls"

Any help would be great, thanks!

Zach
 
Try this...

Private Sub Command0_Click()

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook

Set xlApp = New Excel.Application
xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Open("S:\Production Engineering\SACRAMENTO
RAW MATERIAL COUNTS\ACCESS RAW MATERIALS\BAR COUNT BLANK.xls")

End Sub

Watch out for line wrapping in the filename above...

Pete
 
It didn't work...it says:

compile error:
user deine type not defined

any thoughts? Also I'm not sure....but it looks like this will just open
the excel sheet, that is about 75% of what I want it to do....I would also
like it automatically print & close. Thanks for the help.
 
Back
Top