LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
PO PO is offline
external usenet poster
 
Posts: 66
Default Setting default printer using wsh

Hi

Excel 2000

I use the following wsh script to set the default printer:


Dim oNet
Set oNet =WScript.CreateObject("WScript.Network")

oNet.SetDefaultPrinter("hp LaserJet 1300 PCL 5e")

Set oNet=nothing


(The port name for that printer is DOT4_002)
This works fine and the controlpanel is showing that "hp LaserJet..." is the
default printer. Excel however indicates that the Application.DefaultPrinter
is "unknown". When I set the default printer manually in the controlpanel
Excel recognizes the default printer to be "hp LaserJet 1300 PCL 5e on
Ne02:". I don't understand where Excel gets "on Ne02:" from. The portname
should be DOT4_002.

On some computers Excel still prints correctly to the "hp LaserJet...",
however on others Excel reports an error.

Any ideas?

TIA
po


 
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
setting the default printer for this workbook only mikecoxffbb Excel Worksheet Functions 1 October 25th 08 01:47 AM
members on my network printer not able to print to default printer smeheut Excel Discussion (Misc queries) 0 June 18th 07 06:42 PM
Default printer setting John Excel Discussion (Misc queries) 1 March 22nd 07 03:20 PM
Printer Multiple Worksheets with a particular Printer Setting PP[_2_] Excel Worksheet Functions 0 March 14th 07 02:02 PM
Setting Printer Nathan[_4_] Excel Programming 4 June 23rd 04 05:36 PM


All times are GMT +1. The time now is 12:29 PM.

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

About Us

"It's about Microsoft Excel"