Dim xlsApp As Excel.Application
Dim xlsBook As Excel.Workbook
Dim PRN As Printer
Private Sub Command1_Click()
Set xlApp = CreateObject("Excel.Application")
xlApp.DisplayAlerts = False
Set xlBook = xlApp.Workbooks.Open(App.Path & "\GOOD.xls")
xlApp.Visible = False
Set xlSheet = xlBook.Worksheets("SFNEW")
Call SelPrinter("doPDFv7")
xlSheet.PrintOut
xlBook.Close
xlApp.Quit
Set xlApp = Nothing
End Sub
Public Sub SelPrinter(Pnm$)
For Each PRN In Printers
If PRN.DeviceName = Pnm Then Set Printer = PRN: Exit For
Next
End Sub