Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
James Bromley
 
Posts: n/a
Default excel macro to automatically change default printer

I need a macro to change the default printer to another selected preselected
printer.
I can get a workbook to do this but only after its been opened and then
re-run the macro.
this is to automate a workbook that has to be printed out on one type of
printer only and the users that will have it are not the sharpest biters in
the food chain!!
  #2   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default excel macro to automatically change default printer

Hi James,

Try something like:

'=============
Private Sub Workbook_Activate()
Application.ActivePrinter = "HPPhpoto on LPT1:"
End Sub
'<<=============

'=============
Private Sub Workbook_Deactivate()
Application.ActivePrinter = _
"EPSON Stylus Photo 830U Series on Ne01:"
End Sub
'<<=============

This is workbook event code and should be pasted into the workbook's
ThisWorkbook module *not* a standard module or a sheet module):

Right-click the Excel icon on the worksheet
(or the icon to the left of the File menu if your workbook is maximised)
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.

Change the printers so suit your scenario.


---
Regards,
Norman



"James Bromley" <James wrote in message
...
I need a macro to change the default printer to another selected
preselected
printer.
I can get a workbook to do this but only after its been opened and then
re-run the macro.
this is to automate a workbook that has to be printed out on one type of
printer only and the users that will have it are not the sharpest biters
in
the food chain!!



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
Is it possible to change the default number format in Excel? Andrew Excel Discussion (Misc queries) 5 April 24th 23 09:01 PM
Excel should allow me to change default number formats kakers Excel Discussion (Misc queries) 1 January 11th 06 11:42 PM
How to prevent Excel 2003 from automatically change chart type Oscar II Charts and Charting in Excel 2 October 1st 05 02:57 PM
How to change default page size in Excel proshail Excel Worksheet Functions 2 July 4th 05 08:38 PM
how would i change default user name all excel files learner Excel Discussion (Misc queries) 1 November 29th 04 10:12 PM


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