If strPrinter <> "" Then '如果设置了打印机,就用设置的打印,没有就是默认打印机
For Each p In Printers
If strPrinter = p.DeviceName Then
strPrinter = strPrinter & " 在 " & p.Port
Exit For
End If
' Combo1.AddItem p.DeviceName & " " & p.DriverName & " " & p.Port
Next
objExcel.ActivePrinter = strPrinter