Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Selecting a Printer on a network

You can pop up the select printer dialog and let them choose.

Application.Dialogs(xlDialogPrint).Show
or
Application.Dialogs(xlDialogPrinterSetup).Show




CJLuke wrote:

I have developed a spreadsheet uses a VBA print button, and the following is
the code currently assigned to it:

Application.ActivePrinter = "\\txhoro01\TX-HO-ROAKS-JD23 on Ne07:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\\txhoro01\TX-HO-ROAKS-JD23 on Ne07:", Collate:=True

It selects this printer, and does a good job of printing here in my office.
The problem I have is that the spreadsheet will be distributed to other
people in different places who obviously have different printers. Is there a
way I can create a message box or something similar that will show a list of
the available printers on the network so you can simply select the printer
you would like to print to?


--

Dave Peterson
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Selecting a Printer on a network

Actually, that code doesn't print any pages--it just allows the user to change
printers.

In your existing code, you used
activewindow.selectedsheets....

You could either tell the user to select the sheets to print or you could take
control (in your code) and print them yourself:

worksheets(array("sheet1", "another sheet", "some other sheet")).printout

CJLuke wrote:

Ok, that works just fine, but there is another issue. This only prints the
active sheet, and I don't want the active sheet to print. I need two other
sheets in the workbook to print. Is there any way to do this and still be
able to select the printers?

"Dave Peterson" wrote:

You can pop up the select printer dialog and let them choose.

Application.Dialogs(xlDialogPrint).Show
or
Application.Dialogs(xlDialogPrinterSetup).Show




CJLuke wrote:

I have developed a spreadsheet uses a VBA print button, and the following is
the code currently assigned to it:

Application.ActivePrinter = "\\txhoro01\TX-HO-ROAKS-JD23 on Ne07:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\\txhoro01\TX-HO-ROAKS-JD23 on Ne07:", Collate:=True

It selects this printer, and does a good job of printing here in my office.
The problem I have is that the spreadsheet will be distributed to other
people in different places who obviously have different printers. Is there a
way I can create a message box or something similar that will show a list of
the available printers on the network so you can simply select the printer
you would like to print to?


--

Dave Peterson


--

Dave Peterson
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
members on my network printer not able to print to default printer smeheut Excel Discussion (Misc queries) 0 June 18th 07 06:42 PM
How do I send a spreadsheet to a printer outside the network? Moe in Goffstown Excel Discussion (Misc queries) 3 February 14th 07 04:34 PM
Skittish Ne0x address on network printer AH·C[_8_] Excel Programming 3 December 6th 05 10:25 AM
Skittish Ne0x address on network printer AH·C[_7_] Excel Programming 0 December 5th 05 08:36 AM
selecting network printer Bill Kuunders Excel Programming 0 January 11th 05 08:22 PM


All times are GMT +1. The time now is 12:06 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"