G
Gary
I am able to print an excel.xls from Access using OLE or Automation. I have
the need to print the excel.xls to a smaller size page (i.e. from 11x17 to
letter size).
Here is my VBA Code to print an excel.xls:
Function printxls(filename As String)
Static xlApp As Variant
Static xlBook As Variant
Static xlSheet As Variant
Static path As String
Set xlApp = CreateObject("Excel.Application")
path = "c:\football\user reports\usc coverage chart\"
Set xlBook = xlApp.Workbooks.Open(path & filename & ".xls")
Set xlSheet = xlBook.Worksheets(1)
xlSheet.PrintOut
xlBook.Close (False)
xlApp.Quit
Set xlApp = Nothing
Set xlBook = Nothing
End Function
How can I change the paper size to letter and make it print to fit? These
commands are available on the drop down menu, but I want to do this in VBA
code in Access.
Thank You,
Gary
the need to print the excel.xls to a smaller size page (i.e. from 11x17 to
letter size).
Here is my VBA Code to print an excel.xls:
Function printxls(filename As String)
Static xlApp As Variant
Static xlBook As Variant
Static xlSheet As Variant
Static path As String
Set xlApp = CreateObject("Excel.Application")
path = "c:\football\user reports\usc coverage chart\"
Set xlBook = xlApp.Workbooks.Open(path & filename & ".xls")
Set xlSheet = xlBook.Worksheets(1)
xlSheet.PrintOut
xlBook.Close (False)
xlApp.Quit
Set xlApp = Nothing
Set xlBook = Nothing
End Function
How can I change the paper size to letter and make it print to fit? These
commands are available on the drop down menu, but I want to do this in VBA
code in Access.
Thank You,
Gary