Just printing a document

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

Guest

Hopefully this will be simple....

I have a database with application type buttons in it that open up certain
forms in Excel. Rather than having the forms open (Call shell "filename")
and then allowing the user to do whatever they want in the excel form, is
there a way to just print the form without necessarily opening completely for
editing?

This would be similar to right-clicking on a document in windows explorer
and selecting print.

If this is possible, is there a way to print multiple copies? I am trying
to avoid re-creating blank forms in access that won't do anything but take up
room....

Any help would be appreciated.

Thanks
 
Dim xlApp As Object 'Application Object
Dim xlBook As Object 'Workbook Object
Dim xlSheet As Object 'Worksheet Object

Set xlApp = CreateObject("excel.application")
Set xlBook = xlApp.Workbooks.Open(strFileName, 0, True)
Set xlSheet = xlBook.Worksheets(strSheetName)
'To Preview
xlSheet.PrintPreview
'To Print
xlSheet.PrintOut Copies:=IntPrinCopies, Collate:=True
xlBook.Close
xlApp.Quit
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing
 
Back
Top