+ Reply to Thread
Results 1 to 3 of 3

Changing the active printer

  1. #1
    Registered User
    Join Date
    07-09-2010
    Location
    Helsingborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    26

    Changing the active printer

    I've switched from Excel 2003 to Excel 2010 and suddenly I can't change the active printer via VBA anymore!
    Is there any solution.....and explanation why such a basic and practical function has been removed?
    With the new Excel the Application.ActivePrinter = "alternative printer" cause error 1004.
    Last edited by Mats Samson; 03-15-2012 at 12:03 PM.

  2. #2
    Registered User
    Join Date
    07-09-2010
    Location
    Helsingborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Changing the active printer

    Yes, you are perfectly right! It was a stupid omission from my side!
    I recently changed from English to Swedish Office version and the darn string "sBWPrinter = "SHARP MX-2310U PCL6 on " & Right(sBWPrtPort, 5) still
    contained the word "on" instead of the Swedish "på". So using Application.ActivePrinter = sBWPrinter triggered the error.
    Btw, the reason for changing the printer is because it won't switch to B&W mode (ActiveSheet.PageSetup.BlackAndWhite = True) if the document contains a even a tiny coloured .jpg graphic (our logo). We have a leased printer paying 5x more for a colour printout than a B&W one, so it's annoying when for instance printing an invoice original with 5 B&W copies and still have to pay for coloured ones! I haven't been able to find out if it's Microsoft, Sharp or both behind the problem. Maybe somebody knows!

  3. #3
    Registered User
    Join Date
    07-09-2010
    Location
    Helsingborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Changing the active printer

    Nah, it's an automated process from a form in a registration program I've written. I have the postscript installation of the same printer as default and hard set the PCL version to B&W. Using the switching code I can toggle between them during the printout!
    Thanks anyway, you made me to scrutinize the code and I finally found what caused the error in the text string used by the printer routine!!
    Sometimes it takes very little to create a mess!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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