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
KevinGPO
 
Posts: n/a
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
 
Posts: n/a
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
Excel cannot find printers coopercat Excel Discussion (Misc queries) 0 November 30th 05 05:17 PM
MS Query cannot be started because it isn't installed RogerZ Excel Discussion (Misc queries) 0 August 1st 05 02:06 PM
Installed Analyst Toolpak but not working for files used at work? SJB567 Excel Worksheet Functions 2 May 14th 05 06:50 PM
Installed Word XP only, then applied Office SP3, then Excel - need 2 re-update? Maged Excel Discussion (Misc queries) 0 March 5th 05 10:37 PM
Getting "printer not installed" when trying to edit page setup jac Excel Worksheet Functions 1 March 5th 05 07:19 PM


All times are GMT +1. The time now is 02:23 AM.

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"