+ Reply to Thread
Results 1 to 4 of 4

Print button that still prints when cancelled at the printer setup window

  1. #1
    Registered User
    Join Date
    01-19-2020
    Location
    Athens, Greece
    MS-Off Ver
    2016
    Posts
    2

    Print button that still prints when cancelled at the printer setup window

    Hello.
    I'm trying to set a print button that when pressed, it will show up the available printers and then print out a specific range of cells in a specific number of copies. I've tried the following code.

    Please Login or Register  to view this content.
    It works well with printing but if I press cancel on the printer setup dialog, it still prints. How could I add a code to prevent this?
    Thank you.
    Last edited by Leith Ross; 01-21-2020 at 04:55 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Print button that still prints when cancelled at the printer setup window

    Hello despdel,

    The dialog will return a value for the button you click. It returns False when you select Cancel. Here is the amended code...
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 01-21-2020 at 06:03 PM.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    01-19-2020
    Location
    Athens, Greece
    MS-Off Ver
    2016
    Posts
    2

    Re: Print button that still prints when cancelled at the printer setup window

    Thanks a lot! It worked just fine!

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Print button that still prints when cancelled at the printer setup window

    Hello despdel,

    You're welcome.

+ 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 Button prints out a form different from the one showing on the screen
    By JET2011 in forum Access Tables & Databases
    Replies: 2
    Last Post: 01-31-2018, 03:39 PM
  2. [SOLVED] Printer Setup VBA to print active sheet - Still prints after Cancel
    By hans302 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-30-2017, 09:36 AM
  3. Print Preview Tab and popup window so the user can select printer
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-17-2015, 12:56 PM
  4. [SOLVED] ExecuteExcel4Macro, active printer - prints to another printer - worked on 2007!
    By wonderdunder in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-29-2015, 10:37 AM
  5. Command Button to print to non-default printer
    By mannosteele in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-07-2010, 07:39 PM
  6. Print button, printer settings
    By Thomasha in forum Excel General
    Replies: 0
    Last Post: 08-16-2010, 07:41 PM
  7. Print Button to Set Default Printer
    By vigil87420 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-08-2009, 06:29 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