There is no printer called <name>.
The SetDefaultPrinter method accepts only the names of currently installed printers. This error generally occurs if you specify the printer port instead of the name of the printer, or if you use the name of a printer that is not currently installed.
To correct this error
Check the names of the currently installed printers and make sure the specified printer is installed.
Check the spelling of the printer path for typing errors.
Make sure the networked printer is online.