ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detecting a printer is connected (https://www.excelbanter.com/excel-programming/322626-detecting-printer-connected.html)

Kevin

Detecting a printer is connected
 
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.

Ron de Bruin

Detecting a printer is connected
 
Try this

Untested but try this

If Application.ActivePrinter = "" Then Exit Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"kevin" wrote in message ...
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.





All times are GMT +1. The time now is 04:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com