Try
Dim App As New Excel.Application
App.Visible = True
Dim Wb As Excel.Workbook = App.Workbooks.Open(fl)
Dim Ws As Excel.Worksheet = Wb.Worksheets(1)
App.Visible = False
Dim ps As New Printing.PrinterSettings
ps.PrinterName = drp("打印机")
\'App.ActivePrinter = drp("打印机")
For ii As Integer = 0 To 10
App.ActivePrinter = drp("打印机") & " 在 Ne" & Format(ii, "00") & ":"
Next
For Each ps1 As PaperSize In ps.PaperSizes
If ps1.PaperName = drp("纸张") Then
Ws.PageSetup.PaperSize = ps1.RawKind
End If
Next
Ws.PrintOut(ActivePrinter:=drp("打印机"))
Wb.Save()
App.Quit()
Catch ex As Exception
MsgBox("出现了错误,错误内容:" & ex.Message)
Dim ps As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName("EXCEL")
For Each p As System.Diagnostics.Process In ps
p.Kill()
Next
End Try