Problem : method ‘activeprinter’ of object’_application’ failed
I’m trying to print to a network printer or a PDFprinter. Switching back to the network printer is when I get the method ‘activeprinter’ of object’_application’ failed error. It worked the day I created the macro but the next day it stopped working.
When you run the debugger with MS Visual Basics it gives this Application.ActivePrinter = “\\raleigh1\Savin MLP25n on Ne09:” as the line of error.
‘ PrintPaperLong Macro
ActiveSheet.PageSetup.PrintArea = “$B$2:$J$122”
Application.ActivePrinter = “\\raleigh1\Savin MLP25n on Ne09:”
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
“\\raleigh1\Savin MLP25n on Ne09:”, Collate:=True
Solution: method ‘activeprinter’ of object’_application’ failed
It is probably because the port “Ne09” can and does change. Stop the macro and type in the following and look at the results in your immediate window: ?application.ActivePrinter
Is it the same as what you put in your code? If the “ne..” number is different, the solutions I have seen usually involve looping through all the numbers (Ne00-Ne16) until it does not error out and that is the Ne number that is good. This is a weakness in the excel object model in that you have to enter the specific port name. You can google this topic, but here is the first site I found that talks about it: