+ Reply to Thread
Results 1 to 5 of 5

how to call for printer function

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    849

    how to call for printer function

    I have a printer, and finally figured out that it changes on the name, so its named like this:

    Canon on NE01:
    Canon on NE02:
    Canon on NE04:
    Canon on NE05:
    and so forth
    after searching it came up to something that works on dynamic names of printers from this link: https://www.excelforum.com/excel-pro...numbering.html

    If someone that can help me write the sub to print on whatever the printer name is to print the below sheets:
    Please Login or Register  to view this content.
    i dont know how to call for functions, and just started reading about functions, unsure how to use it yet. If someone would kindly moc up a simple example of this please
    Arkadi in post #30 on that link, if someone that can merged it to print out sheet4 please
    Last edited by chubbychub; 01-16-2024 at 01:51 AM.

  2. #2
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,047

    Re: how to call for printer function

    That function will work
    Put it in a standard module.
    Please Login or Register  to view this content.

    Then call it from your print routine, e.g.
    I've highlighted the function line. Replace "Microsoft Print to PDF" with the full name of your printer as displayed in file/print
    Please Login or Register  to view this content.
    Last edited by ByteMarks; 01-16-2024 at 07:05 AM.

  3. #3
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    849

    Re: how to call for printer function

    thank you Bytemarks for the reply, its sending to the wrong printer, the Printer name changes depeding on which computer, the name of the printer is "Canon on NE01:" "Canon on NE02:", "Canon on NE03" and so forth, depeding on the computer that the macro runs, so can the code in that link from arkadi post #30 be linked to Leith Ross code can be call to search for the printer name and call for it?
    i want tocall for this function before it prints :
    Please Login or Register  to view this content.
    Last edited by chubbychub; 01-16-2024 at 08:51 AM.

  4. #4
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,047

    Re: how to call for printer function

    The on NE01: part is port and is provided by the function which retrieves it from the registry
    So if the name of the printer is "Canon" you could try

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    849

    Re: how to call for printer function

    Bytemarks! thank you! i was trying to figure out how your code works and how it was calling for port number NE0x.. but your code but it loops thru all the printers and just matches what its call from the computer which is great! its better than what i was expecting!. you the best and thank you again! no one answered or replied but you.

+ 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. Can VBA send information to barcode Zebra printer and command it to printer
    By samihaddad2014 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2020, 04:11 PM
  2. Replies: 1
    Last Post: 06-30-2017, 10:29 AM
  3. [SOLVED] Solution to changing Default printer code when printer changes
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-28-2016, 03:12 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. Replies: 0
    Last Post: 11-18-2013, 03:43 AM
  6. Registering Printer Library on computer without printer installed (VBA)
    By Haydan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2013, 03:30 AM
  7. 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

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