Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2009
    Posts
    6

    Unanswered: Late Binding 3rd Party Application to Access

    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:
    Code:
    Dim objBT As BarTender.Application
    Dim objBTFormat As BarTender.Format
    
    Set objBT = CreateObject("Bartender.Application")
    Set objBTFormat = objBT .Formats.Open("\\NetworkLocation\OfBarcodeFormatFile\SimpleBarcode.btw")
    
    objBTFormat .SetNamedSubStringValue "HeaderLabel", Barcode
    objBTFormat .IdenticalCopiesOfLabel = NumBarcodes
    objBTFormat .PrintOut
    
    objBT .Quit
    The examples of late binding I have found look like this:
    Code:
    Dim objXL As Object
        Set objXL = CreateObject("Excel.Application")
    So I just replaced Excel with Bartender and got code like this:
    Code:
    Dim objBT As Object
    Dim objBTFormat as Object
        Set objBT = CreateObject("Bartender.Application")
        Set objBTFormat = objBT.Formats.Open("\\NetworkLocation\OfBarcodeFormatFile\SimpleBarcode.btw")
    I think my issue comes from this line in the original (early bound) code:

    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:

    Code:
    Set objBTFormat = objBT.Formats.Open("\\NetworkLocation\OfBarcodeFormatFile\SimpleBarcode.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 at UtterAccess.

    Any ideas? Open to any suggestions.
    Thanks!
    Nate

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    you'll have to do a check initilly

    You'll have to check if the componant is installed first

    do something like this


    YOULL HAVE TO CHECK THIS BUT SHOULD BE ABOUT RIGHT

    Set app = GetObject(, "Acces.Application")
    If app Is Nothing Then
    msgbox("your pc isn't equipt with the wright settings"
    else
    Set app = CreateObject("Acces.Application")
    end if
    Greetz Marvels -^.^-
    Developments : VB4 Through .Net; Basic; DOS ; CNC ; Sinclair
    Databases : SQL Server Through 2005; Access 3 Through 2003 ; Oracle 8 & 9.i ;
    OS : Win 3.11 Through XP ; NortonComander ; DOS

  3. #3
    Join Date
    Apr 2009
    Posts
    6
    Thanks for your reply.

    Even if i check for the application, and it is installed correctly, i get an error on this line:
    Set objBTFormat = objBT.Formats.Open("\\NetworkLocation\OfBarcodeFor matFile\SimpleBarcode.btw")

    I think it is because access doesn't know what a "Bartender.Format" is. Plus If i follow the rules for late binding, i have to call the "Bartender.Format" an Object rather than this custom variable type.

  4. #4
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    No

    like i said first GET the object later SET the object if it exists

    but just for the heck of it
    could you open a brouwser and paste in : \\NetworkLocation\OfBarcodeFor matFile\
    see if you have permission on that server / drive on that perticaly pc
    Greetz Marvels -^.^-
    Developments : VB4 Through .Net; Basic; DOS ; CNC ; Sinclair
    Databases : SQL Server Through 2005; Access 3 Through 2003 ; Oracle 8 & 9.i ;
    OS : Win 3.11 Through XP ; NortonComander ; DOS

  5. #5
    Join Date
    Apr 2009
    Posts
    6
    I know that i have server permissions. I have already set this up once to work perfectly using the early-bound method.

    I am now testing on a computer where I know the application is installed, and even if i use the Get and then Set, it still gives me the error on the Set statement. Once I can get the code to work on a computer where the application is installed, i will begin testing on my other machine where the application is NOT installed.

    Still looking for help!
    Thanks!
    Nate

  6. #6
    Join Date
    Apr 2009
    Posts
    6
    Phew! I think i got it!

    I posted to three other forums trying to get an answer and I have stumped everyone!
    But alas... i have solved this problem.

    I took another look at the help file for the Bartender application, and found a section i did not see before.

    The error i was getting while trying to late bind bartender was that the argument was not optional.

    To me that meant that i was not filling in all of the required fields. So i looked up the fields in the help file, and even though it said that they were all optional, i think that is only for early bound application. since i was late binding the program is requiring me to fill in all fields.

    I added a couple minor things and came up with this:

    Code:
    Dim BtAppAny As Object
    Dim MPHLFormatAny As Object
    
    Set BtAppAny = CreateObject("Bartender.Application")
    
    Set MPHLFormatAny = BtAppAny.Formats.Open("\\NetworkLocation\SimpleBarcode.btw", True, "")
    
    MPHLFormatAny.SetNamedSubStringValue "HeaderLabel", Barcode
    MPHLFormatAny.SetNamedSubStringValue "Date", Date
    MPHLFormatAny.IdenticalCopiesOfLabel = NumBarcodes
    
    MPHLFormatAny.PrintOut False, False
    BtAppAny.Quit 1
    
    Set MPHLFormatAny = Nothing
    Set BtAppAny = Nothing
    Thank you for you continued support! I have learned a lot about late and early binding in trying to solve this problem.

    Nate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •