-
May 19th, 2017, 04:09 PM
#1
Thread Starter
Junior Member
Using VBA in Excel to print to Brother Label Printer
Hi all...
Crazy problem here. I have a new QL-700 label printer that purports to allow printing from VBA, .Net and such... and comes with example files.
Running from Excel, their example code never works... at least not right off.
They have two versions of the SDK... 32 and 64 bit.
I got it to work finally on my Win 10 machine with Excel 2016 (Pro Plus)... by adding what they call the "Client Component"... which seems to point toward a Reference: "Brother b-PAC 3.1 Type Library".
The Component appears to install the 32 bit version of the libraries, because they are stored under the Program Files (x86) structure.
The SDK (which needs to be the 64 bit version) also must be installed, and lives under the Program Files structure.
Things get ugly when I try to move this to a Windows 7 Machine... and Excel 2010.
It simply refuses to work... and fails silently, even using the Brother example code.
One issue may be that for some reason, the 64 bit SDK ALWAYS asserts itself over the 32 bit version that comes with the Client Component. Even when I see the Client Component in the References list in the x86 installation, selecting it in the VBA IDE magically transforms it into the 64 bit install.
Perhaps it's a conflict between a 64 bit OS, and a 32 bit Excel?
I have no idea what to do at this point... I don't really understand it much.
Hours of Google searches have yielded no working solutions.
Any thoughts / ideas greatly appreciated.
-
May 19th, 2017, 05:16 PM
#2
Re: Using VBA in Excel to print to Brother Label Printer
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
May 19th, 2017, 05:25 PM
#3
Thread Starter
Junior Member
Re: Using VBA in Excel to print to Brother Label Printer
Originally Posted by westconn1
Yes I did... That description if of an issue that causes an error... in my case, it fails silently.
-
May 19th, 2017, 11:22 PM
#4
Re: Using VBA in Excel to print to Brother Label Printer
try unregistering (or uninstalling) the 64 bit version, on machines where office is 32 bit, it clearly states the 64bit version only works with 64 bit applications regardless of OS
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
May 22nd, 2017, 12:20 PM
#5
Thread Starter
Junior Member
Re: Using VBA in Excel to print to Brother Label Printer
Originally Posted by westconn1
try unregistering (or uninstalling) the 64 bit version, on machines where office is 32 bit, it clearly states the 64bit version only works with 64 bit applications regardless of OS
Right, the code failes. "Application error. The specified module could not be found."
Code:
Dim ObjDoc As bpac.Document
Set ObjDoc = CreateObject("bpac.Document") '<--- FAILS
To be clear, this is when the 64 bit is uninstalled... and only the 32 bit and "client component" are installed.
I'm not clear on what the error message is telling me.
Last edited by SpacemanSpiff; May 22nd, 2017 at 04:38 PM.
-
May 23rd, 2017, 04:27 PM
#6
Re: Using VBA in Excel to print to Brother Label Printer
i will try to have a play with this later, i do have a ql printer, but i have never automated its use
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|