ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   setting the default printer for this workbook only (https://www.excelbanter.com/excel-worksheet-functions/207738-setting-default-printer-workbook-only.html)

mikecoxffbb

setting the default printer for this workbook only
 
i cant figure out how to set and ar save a particular workbook so that only
that workbook prints to a printer that is not my default printer. i woudl
like to keep it like this so i dont have to go and change the printer in the
primnt menue everytime i print. can anyone help me ?

ShaneDevenshire

setting the default printer for this workbook only
 
Hi,

Excel does not support a feature such as this, although you might be able to
program it.

It would look something like this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Application.ActivePrinter = "Microsoft Office Document Image Writer
on Ne01:"
End Sub

To do this you need to record the macro, turn on the recorder - Tools,
Macros, Record new macro, leave the default name, make sure it is Storing to
This workbook.
After you click OK, choose File, Print and either pick the Name from the
list or choose Find Printer...
Eventually click OK to print and then Stop the Recorder - choose Tools,
Macros, Stop recorder.

The code needs to go into the thisWorkbook_BeforePrint macro. Press
Alt+F11, in the Project window at the top left find your workbook's name and
under it the item called thisWorkbook, double-click it and enter the lines of
code I gave you but put you code between the Sub and End Sub lines. Your
code will be in a folder under your filename in the project window called
Modules, in that folder double-click Module 1 and copy the line that looks
like mine from between the Sub and the End Sub lines, paste it in the
thisWork code we just entered.


If this helps, please click the Yes button.

--
Thanks,
Shane Devenshire


"mikecoxffbb" wrote:

i cant figure out how to set and ar save a particular workbook so that only
that workbook prints to a printer that is not my default printer. i woudl
like to keep it like this so i dont have to go and change the printer in the
primnt menue everytime i print. can anyone help me ?



All times are GMT +1. The time now is 06:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com