mindlessmalk
04-03-2009, 04:55 AM
I use a 3rd party bar code creation application by Seagull scientific called BarTender 7.0.
I am using windows XP Pro SP2 with Access 2003.
I am using BarTender as an early-bound reference to print formatted bar code labels from my database.
However a few computers do not have the Bartender program installed, and therefor they get the "Missing or broken reference file." error. The error is not associated with a number, so i am not sure how to "catch" it and handle it internally by disabling the bar code feature of the application.
From what I have researched it sounds like I need to late bind BarTender using a similar method to the way you would late-bind other Office applications. I cannot get it to work right.
Here is the original code to print a bar code using the early-bound application:
Dim objBT As BarTender.Application
Dim objBTFormat As BarTender.Format
Set objBT = CreateObject("Bartender.Application")
Set objBTFormat = objBT .Formats.Open("\\NetworkLocation\OfBarcodeFormatFile\SimpleBarcod e.btw")
objBTFormat .SetNamedSubStringValue "HeaderLabel", Barcode
objBTFormat .IdenticalCopiesOfLabel = NumBarcodes
objBTFormat .PrintOut
objBT .Quit
The examples of late binding I have found look like this:
Dim objXL As Object
Set objXL = CreateObject("Excel.Application")
So I just replaced Excel with Bartender and got code like this:
Dim objBT As Object
Dim objBTFormat as Object
Set objBT = CreateObject("Bartender.Application")
Set objBTFormat = objBT.Formats.Open("\\NetworkLocation\OfBarcodeFormatFile\SimpleBarcod e.btw")
I think my issue comes from this line in the original (early bound) code:
Dim objBTFormat As BarTender.Format
If I change this variable to an object (as I did with the application variable) then I get an error when this variable is assigned a value using the code:
Set objBTFormat = objBT.Formats.Open("\\NetworkLocation\OfBarcodeFormatFile\SimpleBarcod e.btw")
That is where I get the error: "449- Argument not optional"
So I need a way to completely late bind this bartender application so that i can disable bar code functions if a computer does not have the BarTender application installed.
I have been struggling with this issue all week long and I have contacted the Seagull Support people (who were no help at all) I also have an active thread on this topic over here at UtterAccess. (http://www.utteraccess.com/forums/showflat.php?Cat=&Number=1806602&page=&view=&sb=5&o=&fpart=all&vc=1)
Any ideas? Open to any suggestions.
Thanks!
Nate
I am using windows XP Pro SP2 with Access 2003.
I am using BarTender as an early-bound reference to print formatted bar code labels from my database.
However a few computers do not have the Bartender program installed, and therefor they get the "Missing or broken reference file." error. The error is not associated with a number, so i am not sure how to "catch" it and handle it internally by disabling the bar code feature of the application.
From what I have researched it sounds like I need to late bind BarTender using a similar method to the way you would late-bind other Office applications. I cannot get it to work right.
Here is the original code to print a bar code using the early-bound application:
Dim objBT As BarTender.Application
Dim objBTFormat As BarTender.Format
Set objBT = CreateObject("Bartender.Application")
Set objBTFormat = objBT .Formats.Open("\\NetworkLocation\OfBarcodeFormatFile\SimpleBarcod e.btw")
objBTFormat .SetNamedSubStringValue "HeaderLabel", Barcode
objBTFormat .IdenticalCopiesOfLabel = NumBarcodes
objBTFormat .PrintOut
objBT .Quit
The examples of late binding I have found look like this:
Dim objXL As Object
Set objXL = CreateObject("Excel.Application")
So I just replaced Excel with Bartender and got code like this:
Dim objBT As Object
Dim objBTFormat as Object
Set objBT = CreateObject("Bartender.Application")
Set objBTFormat = objBT.Formats.Open("\\NetworkLocation\OfBarcodeFormatFile\SimpleBarcod e.btw")
I think my issue comes from this line in the original (early bound) code:
Dim objBTFormat As BarTender.Format
If I change this variable to an object (as I did with the application variable) then I get an error when this variable is assigned a value using the code:
Set objBTFormat = objBT.Formats.Open("\\NetworkLocation\OfBarcodeFormatFile\SimpleBarcod e.btw")
That is where I get the error: "449- Argument not optional"
So I need a way to completely late bind this bartender application so that i can disable bar code functions if a computer does not have the BarTender application installed.
I have been struggling with this issue all week long and I have contacted the Seagull Support people (who were no help at all) I also have an active thread on this topic over here at UtterAccess. (http://www.utteraccess.com/forums/showflat.php?Cat=&Number=1806602&page=&view=&sb=5&o=&fpart=all&vc=1)
Any ideas? Open to any suggestions.
Thanks!
Nate