Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check there is a printer?

Status
Not open for further replies.

RogADog

Programmer
Feb 26, 2003
23
GB
Re Excel 97 on NT4

Before getting to:

Worksheet.Printout

is it possible for VBA to check that:

1. The current user has installed a printer on the PC
2. The printer is switched on

Or is the only way to prevent this kind of error the use of an error trapper?

Rog
 
Rog,

I wrote the below in Excel XP to make sure there is a printer installed.
Code:
Sub testforprinter()
b$ = ActivePrinter
If b$ = "unknown printer (check your Control Panel)" Then
  MsgBox ("You need to have a printer installed on your pc. Go to 'Printers & Faxes' and connect to your local printer")
  End
End If
End Sub
I don't know if it's possible to check that the printer is actually switched on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top