+ Reply to Thread
Results 1 to 7 of 7

Operating Brother QL-570 Label Printer with Excel VBA

  1. #1
    Registered User
    Join Date
    02-09-2016
    Location
    Sydney, Australia
    MS-Off Ver
    2013
    Posts
    3

    Operating Brother QL-570 Label Printer with Excel VBA

    I recently purchased a Brother QL-570 label printer, unfortunately it doesn't operate when I try to use VBA samples provided by Brother:

    Please Login or Register  to view this content.
    I've made sure to included the b-Pac reference library in Excel VBA.
    I've also stepped through the code, no errors occur. Any suggestions on how I could get this to work?

  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: Operating Brother QL-570 Label Printer with Excel VBA

    Hello sdfryc,

    I suspect your problem lies within these 2 lines:
    Please Login or Register  to view this content.
    The Dim statement is used to declare an object variable of the type bpac.Document. This statement will only work with Early Binding which means the object library has been loaded. In your case, this would be true since you said, "I've made sure to included the b-Pac reference library in Excel VBA. "

    The CreateObject statement is used to load an object library and instantiate the object at run-time. This is referred to as Late Binding.

    Try changing this statement to...
    Please Login or Register  to view this content.
    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
    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: Operating Brother QL-570 Label Printer with Excel VBA

    Hello sdfryc,

    I suspect your problem lies within these 2 lines:
    Please Login or Register  to view this content.
    The Dim statement is used to declare an object variable of the type bpac.Document. This statement will only work with Early Binding which means the object library has been loaded. In your case, this would be true since you said, "I've made sure to included the b-Pac reference library in Excel VBA. "

    The CreateObject statement is used to load an object library and instantiate the object at run-time. This is referred to as Late Binding.

    Try changing this statement to...
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-09-2016
    Location
    Sydney, Australia
    MS-Off Ver
    2013
    Posts
    3

    Re: Operating Brother QL-570 Label Printer with Excel VBA

    Hi Leith,

    Thanks for your suggestion. I tried changing the statement, unfortunately it creates a Compile Error:

    Compile Error.JPG

    Regards,
    Simon

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Operating Brother QL-570 Label Printer with Excel VBA

    Since you're using Option Explicit () this means that you didn't declare your objDoc with a Dim statement.
    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.

  6. #6
    Registered User
    Join Date
    02-09-2016
    Location
    Sydney, Australia
    MS-Off Ver
    2013
    Posts
    3

    Re: Operating Brother QL-570 Label Printer with Excel VBA

    Hi bakerman2,

    I've tried removing Option Explicit which didn't help.
    I've also tried keeping Option Explicit and declaring the objDoc with a Dim statement, this allows the code to run but still doesn't operate the printer.

  7. #7
    Registered User
    Join Date
    11-16-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Operating Brother QL-570 Label Printer with Excel VBA

    Hi Comunity:

    The solution that works for me, is in vba ribbon check references:

    Brother b-pac 32 type Library (activate)

    The problem was excel vba dll not operative

    Greets


    Attachment 753566

+ 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. Please help a brother - Macro
    By AlexanderAB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2017, 11:40 AM
  2. VBA label printer initialization fails with Excel but never with Word
    By MadAboutNothing in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2016, 02:47 PM
  3. Excel to label printer
    By monday in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2014, 06:53 AM
  4. VBA code to print defined cells to a thermal label printer
    By parkles in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2012, 04:06 AM
  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. Hellow bROTHER :D
    By garry.handsome in forum The Water Cooler
    Replies: 2
    Last Post: 01-22-2010, 03:55 AM
  7. Operating Word from Excel
    By Phonic in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2009, 10:23 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