+ Reply to Thread
Results 1 to 18 of 18

Solution to changing Default printer code when printer changes

  1. #1
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Solution to changing Default printer code when printer changes

    Hi All

    I have the below code which will print out a specific sheet with a different printer. This will work as long as the printers don't change. How can I solve a problem if one of the printers gets replaced. Let's say the Canon breaks and is replaced with a different printer. This code won't work anymore.
    What can I do to work around this problem.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Solution to changing Default printer code when printer changes

    Is there a way that when the button on the userform is pressed, the printer properties box comes up and the user can manually select the printer and once printed, goes back to default "Current Printer".

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Solution to changing Default printer code when printer changes

    Hi,

    You can use
    Please Login or Register  to view this content.
    to show the dialog to change printers, and then reset it at the end of the code as you do at the moment.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Solution to changing Default printer code when printer changes

    Thanks xlnitwit

    Perfection as always

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Solution to changing Default printer code when printer changes

    A quick question xlnitwit...

    How can I suppress the message that pops up with okay and cancel option

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Solution to changing Default printer code when printer changes

    What message? Can you provide a screenshot, or the title of the message?

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Solution to changing Default printer code when printer changes

    Here you go
    MESSAGE-.png

  8. #8
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Solution to changing Default printer code when printer changes

    You might try adding an Application.DisplayAlerts = False line but I am not convinced it will work as that is a printer dialog box rather than an Excel one.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Solution to changing Default printer code when printer changes

    Yeah tried that but no avail....Thanks for your time xlnitwit

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Solution to changing Default printer code when printer changes

    Please help xlnitwit

    I have a huge problem....

    The below code brings up the attached image. When I click cancel, all my installed printers gets deleted. This has happened 3 times already. Any ideas.Untitled-1.png
    Please Login or Register  to view this content.

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Solution to changing Default printer code when printer changes

    I have no idea why this is happening

  12. #12
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Solution to changing Default printer code when printer changes

    Which version of Windows and excel are you using?

  13. #13
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Solution to changing Default printer code when printer changes

    Windows Ultimate and excel 2007

  14. #14
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Solution to changing Default printer code when printer changes

    Windows Ultimate which version? (Regrettably if this is an Excel 2007 bug I imagine you will be out of luck now)

  15. #15
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Solution to changing Default printer code when printer changes

    Hi xlnitwit

    I am using Windows 7

  16. #16
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Solution to changing Default printer code when printer changes

    Hi sintek,

    Maybe this will be of some help; http://www.mrexcel.com/forum/excel-q...t-printer.html

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  17. #17
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Solution to changing Default printer code when printer changes

    So....Does this mean that I am not able to use this code:
    Please Login or Register  to view this content.
    Is there another solution perhaps?

  18. #18
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Solution to changing Default printer code when printer changes

    Hey there Winon

    That code, when used, deletes my installed printers, as per previous post explanations.

+ 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] Setting and changing default printer
    By bigfishprf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2016, 05:49 PM
  2. How Do I Code to print to a Printer by the Printer Name?
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2013, 05:28 PM
  3. VBA code to use default printer on local pc for printing
    By DanishDudeAU in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2013, 02:40 AM
  4. Can I pass printer properties to the default printer?
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2012, 04:11 PM
  5. 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
  6. 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
  7. Excel changing Default Printer
    By Brad in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2005, 01:06 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