Detecting a printer is connected

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

I have a macro that prints a form but errors if no printer is attached. What
would the vba code be for detecting a printer and ending the sub if one is
not conected

many thanks.

kevin.
 
Try this

Untested but try this

If Application.ActivePrinter = "" Then Exit Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top