I'm stumped by the error I'm getting here - this code finds the DYMO label writer installed on a machine and successfully prints a label...
But I get the error Type Mismatch at the line of code noted.Code:Dim prtPrinter As Printer, prtPriorPrinter As Printer
For Each prtPrinter In Printers
If Left(prtPrinter.DeviceName, 4) = "DYMO" Then
Set prtPriorPrinter = Printer
Set Printer = prtPrinter
Printer.Orientation = vbPRORLandscape
Printer.FontSize = 10
Printer.Print "Line 1"
Printer.Print "Line 2"
Printer.EndDoc
Set Printer = prtPriorPrinter <- The error occurs at this line ***
Exit For
End If
Next
What am I doing wrong?

