+ Reply to Thread
Results 1 to 3 of 3

VBA code to use default printer on local pc for printing

  1. #1
    Registered User
    Join Date
    10-29-2013
    Location
    Perth, Western Australia
    MS-Off Ver
    Excel 2007
    Posts
    5

    VBA code to use default printer on local pc for printing

    Hi,

    I'm trying to get some coding changed to be able to use whatever default printer a user have on their windows pc to print specific sheet. Currently the code I have to work with is:

    Please Login or Register  to view this content.
    But I need to have the Application.ActivePrinter changed so it uses the default printer from windows O/S.

    Hope someone can give me a helping hand to get this working.

    Thanks.
    Last edited by arlu1201; 11-12-2013 at 07:35 AM. Reason: Use code tags in future.

  2. #2
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: VBA code to use default printer on local pc for printing

    Hi DanishDude,

    Here is some code that worked for me. It basically sets the print area to the range "PaysheetPrint", then sets the page layout so that the selected print area is scaled to fit on one sheet of 8 1/2 x 11 paper and then it selects the "PaysheetPrint" range and prints it. Setting the print area and the page layout to "PaysheetPrint" may be redundant, but it is late here, so I thought I would post this before I fall asleep in my chair. The code is given below:

    Please Login or Register  to view this content.
    Hope this helps,

    Daniel
    Last edited by djbomaha; 11-13-2013 at 02:30 AM.

  3. #3
    Registered User
    Join Date
    10-29-2013
    Location
    Perth, Western Australia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: VBA code to use default printer on local pc for printing

    Hi Daniel,

    This worked like a charm, thank you very much for your help.

    Cheers,
    Jesper

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Print box rather than printing to the default printer
    By RebeccaEllis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2012, 03:39 PM
  2. Printing Macro Problem - Setting Default printer
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2012, 03:37 AM
  3. macro to print 2 copies to default printer, then 1 copy to Adobe PDF printer
    By jwright650 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2011, 01:07 PM
  4. Code to print all files in a folder (to default printer)
    By jwhitwell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2010, 04:35 PM
  5. Printing from default printer
    By Susan in forum Excel General
    Replies: 1
    Last Post: 02-01-2006, 12:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1