Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default HELP: how to detect if printers are installed? woes :S

I made a Excel template with a macro to set up page margins, etc for the
printer. This macro is ran when you load up the Excel template.

However, if once doesn't have any printers installed, they get a warning to
chose/find/setup a printer.

Does anyone know in VBA how to detect whether any printers are installed. If
no printer is installed then bypass my printer setup code?


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 789
Default HELP: how to detect if printers are installed? woes :S

Hi
An error message is generated when you try and print with no printer.
I Googled this group and found this code from Tom Ogilvy which you
might be able to adapt. I don't know how you catch the error without
trying the print though - maybe some kind of test print when the user
first tries to use your code, which then gives a warning if no print
possible?

Sub PrintInvoice()
Dim Res As Long
Res = MsgBox("Do you want to print the invoice?", vbQuestion +
vbYesNo)
Select Case Res
Case vbYes
On Error Resume Next
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
if err.Number < 0 then _
MsgBox "Error: " & err.Description, vbOK +
vbInformation
Err.clear
On Error goto 0
Case vbNo
Exit Sub
End Select
End Sub

regards
Paul

KevinGPO wrote:
I made a Excel template with a macro to set up page margins, etc for the
printer. This macro is ran when you load up the Excel template.

However, if once doesn't have any printers installed, they get a warning to
chose/find/setup a printer.

Does anyone know in VBA how to detect whether any printers are installed. If
no printer is installed then bypass my printer setup code?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP: how to detect if printers are installed? woes :S KevinGPO Excel Worksheet Functions 1 March 14th 06 09:58 AM
Printers Jason Zischke Excel Programming 4 December 1st 05 02:05 AM
list o installed printers Arkaad Excel Programming 1 September 14th 04 10:52 AM
Detect what version (if any) of Excel is installed Keith Brautigam Excel Programming 6 April 2nd 04 12:54 AM
Printers & LPT Tom Excel Programming 0 November 26th 03 05:39 PM


All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"