0
votes

I have created a macro that will print out my workbook on Excel. I have linked a button to the macro and then I have recorded it to print as an XPS document and this works correctly once completed. However, when I close the workbook and reopen it again and press the button which links to the print macro it prints to the default printer, but not the XPS one which I originally recorded it as in the macro.

Is there a simple way to fix this problem so that it prints as an XPS and not to my default printer? So far i have tried adding the following to my macro:

Application.ActivePrinter = _ "Microsoft XPS Document Writer"

Why isn't this method working?

1
that should work. If the printer is not defined, then an error 1004 should be raised. Check your error handling, and make sure you are not ignoring all errors with an On Error Resume NextSeanC

1 Answers

0
votes

You probably have the name slightly wrong. Do a MsgBox "Printer set to - " & Application.ActivePrinter

after you have manually changed the printer to XPS writer. Then use the provided name in your statement. That should work.