printing vba
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and Help » Printing in VBA

Printing in VBA

The UK's most regular instructor-led training courses.
Training information: excel training in uk · Excel-courses-london · VBA courses London UK

resolvedResolved · Urgent Priority · Version 2003

Printing in VBA

Nick has attended:
Excel VBA course
Excel VBA course

by - delegate Nick [3 posts] (2008 Apr 28 Mon, 15:20) replyReply

The function .PrintOut will print the document to the default printer..... What is the code which will launch the print dialogue box and alow the user to select which printer to print the document to?

Thanks,

Nick Smith

Excel Advanced 1 day course
Version Date Location Places
available
Book Next place rate:
Card Invoice
2003/XP 2008 Aug 11 Mon Bayswater 0 FULL    
2003/XP 2008 Aug 13 Wed Tooting 0 FULL    
2007 2008 Aug 13 Wed Bloomsbury 0 FULL    
2003/XP 2008 Aug 15 Fri Southwark 3 book now £224 £235
2003/XP 2008 Aug 20 Wed Southwark 2 book now £235 £240
2003/XP 2008 Aug 22 Fri Bloomsbury 4 book now £224 £235
Full Schedule: See all 134 Excel Advanced course dates.
Bookings currently available until 24th November 2009.

RE: Printing in VBA

by - trainer Stephen gold contributer[306 posts] (2008 May 9 Fri, 11:16) replyReply

Hi Nick

Thank you for your question

Your best option would be to write a procedure that allows the user to specify which printer is to be the active printer.

I general i would populate a combo box with a list of the available printers and have the user select the printer there. I would then write code that allocates the value of the combo box to a string variable. I would then use this variable to specify the active printer.

The crucial line of code would be

application.activeprinter = strvariable

It is obviously important to correctly name the printers in the combo box

Regards

Stephen

RE: Printing in VBA

by - delegate Nick [3 posts] (2008 May 9 Fri, 13:06) replyReply

Thanks for the response Stephen...

The challenge with the combo box idea is that this code is to be used by 70 hotels around the country all with their own choices of networked printers..... Therefore i would be unable to source the addresses for each of the possible printer options.

Is there no code which would just launch the print dialogue box as if you had just clicked on the print button from the file menu?

Thanks,

Nick

RE: Printing in VBA

by - trainer Stephen gold contributer[306 posts] (2008 May 9 Fri, 13:51) replyReply

Hi Nick

Thanks for your reply. Sorry misunderstood precisely what you required

The following line of code will display the print dialog box

Application.Dialogs(xlDialogPrint).Show

Hope this helps. If you need anything else, please let me know

Regards

Stephen


Related articles

· Microsoft Excel Cheat Sheet: Tips and Shortcuts
· Microsoft Excel Features and Functions for Accountants
· A Beginners Guide To Formulas In Excel
· Excel Advanced Courses Ease the Frustration of Learning Complex Tasks
· Excel Macros for the Non-Programmer

Please browse our web site to find out more about
excel training in uk and other Microsoft training courses.

Excel tip:

Do a fast scroll

In big Excel databases with many records, you can move down thousands of rows super-fast as follows: hold down Shift then click on the scrollbar somewhere below the scrollbar handle. This will move you way down the sheet without your having to use the scrollbar up/down arrows or drag on the scrollbar handle.

View all Excel hints and tips

Institute of IT Training - Accredited Training Provider Institute of IT Training - Accredited Training Provider Prodigy Platinum Learning Partner Microsoft Office Specialist Authorised Testing Centre

Microsoft Registered Partner
microsoft office
ms office project server

Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information
AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz