+ Reply to Thread
Results 1 to 13 of 13

Printing Labels on Zebra Printer

  1. #1
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Office 365
    Posts
    124

    Printing Labels on Zebra Printer

    Hi,

    I have a spreadsheet that has a UserForm and that has a button called "Print Label".

    To make that button work I have written the following code:
    Please Login or Register  to view this content.

    When I click on the button, the information on the Label tab gets printed to a normal network printer if I forget to switch it to the zebra label printer.
    I have done a lot of searching and can not find a solution.

    Information about the label printer:
    Printer Name: MSP-Label2
    Printer Network: MSP-Label2 on MPS-DC-001

    Picture attached

    Thanks!
    Attached Images Attached Images

  2. #2
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: Printing Labels on Zebra Printer

    Try modding the code with this on the second to last line:
    Please Login or Register  to view this content.
    Pete

  3. #3
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Office 365
    Posts
    124

    Re: Printing Labels on Zebra Printer

    Please Login or Register  to view this content.
    Compile error: Invalid or unqualified reference

    Please Login or Register  to view this content.
    Prints on default network printer.

    I have tried to use the following websites for help, but I could not get it to work.
    https://stackoverflow.com/questions/...ocket-printing
    http://www.vbforums.com/showthread.p...pl-code-SOLVED!!

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Printing Labels on Zebra Printer

    You need to get this part working before moving onto more complex tasks.

    No point in being able to print the labels automatically if you can't print them in the right place.

    See if this works, the idea was right, but there was a typo in the printer name from Pete's post (msp nstead of mps), so it would not have been found.

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: Printing Labels on Zebra Printer

    I took it from the OP. (I didn't catch that the post didn't match the properties in the printer dialogue box.)
    Live and learn.
    Pete

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Printing Labels on Zebra Printer

    Easily missed, Pete!

    I was comparing the code to the properties, looking for extra / missing spaces, etc. I went over it 3 times before noticing the error.

    If I had been replying to this initially, I would have done the same as you and copied the name from the information given by the OP as opposed to retyping it from the image.

    I compared your reply to the code in post #3 and could see no difference so then I compared yours to the image, solely because both fit on the screen together without scrolling up and down, if I had looked at the text above the image instead and compared that to your reply then I might not have noticed the typo.

  7. #7
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Office 365
    Posts
    124

    Re: Printing Labels on Zebra Printer

    Sorry but none of this worked.
    Here is what I have tried:
    Please Login or Register  to view this content.
    This brings up a box where I can select the printer, and that name is in a different formatMicrosoft_Excel_Production_Tags.jpg

    Using advise from https://www.mrexcel.com/forum/excel-...ter-macro.html
    that brings up: Microsoft_Excel_Production_Tags 2.jpg

  8. #8
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Office 365
    Posts
    124

    Re: Printing Labels on Zebra Printer

    This doesn't work:
    Please Login or Register  to view this content.
    Last edited by YuriyBaron; 09-05-2018 at 05:43 PM.

  9. #9
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Printing Labels on Zebra Printer

    The location of the printer has moved since the original post, so that needs to be taken into consideration.

    Will dig around and see what I can find out.

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,259

    Re: Printing Labels on Zebra Printer

    According to your image it's
    Please Login or Register  to view this content.
    and not mps like you put in your code.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  11. #11
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Office 365
    Posts
    124

    Re: Printing Labels on Zebra Printer

    Excellent catch. However, that did not work. After messing with this for a few hours I eventually got it to work!

    Here is the final code:
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Office 365
    Posts
    124

    Re: Printing Labels on Zebra Printer

    Reputation added to everyone who contributed, post labeled as solved.

    Thanks, everyone for the input!

    Now on to the next issue: https://www.excelforum.com/excel-pro...ml#post4963796

  13. #13
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,259

    Re: Printing Labels on Zebra Printer

    Glad to help and thanks for rep+.

+ 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. Replies: 1
    Last Post: 06-30-2017, 10:29 AM
  2. Printing to a printer and to a pdf at the same time.
    By mrclamp87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-24-2013, 10:52 AM
  3. printing to a printer without asking which printer
    By cuewoz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2009, 02:34 AM
  4. Printing from IE7 to Exel instead of printer
    By Washington in forum Excel General
    Replies: 2
    Last Post: 05-07-2007, 08:51 AM
  5. Printing with B&W printer
    By edwardpestian in forum Excel General
    Replies: 1
    Last Post: 07-24-2006, 11:56 PM
  6. [SOLVED] Printing labels on a dot matrix printer - what does this code do
    By Laurence Lombard in forum Excel General
    Replies: 2
    Last Post: 06-19-2006, 08:25 AM
  7. [SOLVED] Printing labels on a dot matrix printer - what does this code do
    By Laurence Lombard in forum Excel General
    Replies: 0
    Last Post: 06-18-2006, 02:25 AM

Tags for this Thread

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