Rocky Smolin - Beach Access Software
bchacc at san.rr.com
Mon Aug 7 13:42:50 CDT 2006
It says Formats is a member of Bar Tender. and Open is a member of Formats. Where do I see the data type being returned? T&R Rocky MartyConnelly wrote: > Err the Object Browser should tell you the data type being returned. > if you have the reference set. > > MartyConnelly wrote: > > >> If you are setting it, you must be returning an object rather than a >> variant. >> Set a reference to bartender and look at the values in the Object Browser >> libary for Bartender to see what they should be set to. >> >> Rocky Smolin - Beach Access Software wrote: >> >> >> >> >>> Marty: >>> >>> I deleted the Reference to Bartender and changed the declarations to: >>> >>> Public BtApp As Object 'BarTender.Application >>> Public BtFormat As Variant 'BarTender.Format >>> >>> In the load event I put: >>> >>> Set BtApp = CreateObject("BarTender.Application") >>> In the Print event however, on the line >>> >>> Set BtFormat = BtApp.Formats.Open(Me.fldFABLabelFile) >>> >>> I get an 'argument not optional' error. With the old declarations it >>> worked. Any idea what's going wrong? >>> >>> Thanks and regards, >>> >>> Rocky >>> >>> >>> MartyConnelly wrote: >>> >>> >>> >>> >>> >>>> You are mixing Early and Late Binding methods >>>> First remove the reference >>>> Then just change your declarations to things like >>>> >>>> Public BtApp As Object 'BarTender.Application >>>> Public BtFormat As String 'BarTender.Format >>>> >>>> >>>> If you are unsure of the type returned try using a variant >>>> especially in the case of returned arrays. >>>> >>>> or leave both types in and do a conditional compile around them >>>> >>>> #Const DebugVersion = 0 >>>> >>>> #if DebugVersion = 1 then >>>> Dim wa as BarTender.Application >>>> Set wa = new BarTender.Application >>>> #else >>>> Dim wa as Object >>>> set wa = createobject ("BarTender.Application") >>>> #endif >>>> You'l have to set the flag to 1 >>>> (#Const DebugVersion = 1) >>>> and then add a reference to Bartender >>>> for the debug intellisence to work.. >>>> >>>> Then to check if Bartender is actually installed on the machine >>>> >>>> On Error Resume Next >>>> Set objExcelapp = CreateObject("BarTender.Application") >>>> If Err.Number Then >>>> MsgBox "Bartender not installed or not registered for Automation" >>>> Exit Sub >>>> End If >>>> 'reset error >>>> >>>> >>>> >>>> >>>> Rocky Smolin - Beach Access Software wrote: >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>> Dear List: >>>>> >>>>> I have a client who prints bar coded labels through an application >>>>> called Bartender (cute, huh?). I wrote a production management system >>>>> for them which contains all the information in the db that they are >>>>> inputting manually into Bartender. So the client asked me to add a >>>>> function to the app to run Bartender from the production system and that >>>>> is working great. >>>>> >>>>> To do this I downloaded and installed the trial version of Bartender and >>>>> so was able to set a reference to it in the VBA code so I could run >>>>> Bartender from the client's app (stuff like Public BtApp As >>>>> BarTender.Application and Public BtFormat As BarTender.Format and Set >>>>> BtApp = CreateObject("BarTender.Application")). >>>>> >>>>> Problem is that the app won't run on any machine which doesn't have >>>>> Bartender loaded - it gets a broken reference error when the app opens. >>>>> >>>>> So I'm wondering how to handle this. Perhaps I unset the reference in >>>>> the Tools-->References and set it when the bar code form opens? Or is >>>>> there a way to trap and get around this error when the app loads? >>>>> >>>>> What's the best way to handle this? >>>>> >>>>> MTIA, >>>>> >>>>> Rocky >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >>> >> >> >> > > -- Rocky Smolin Beach Access Software 858-259-4334 www.e-z-mrp.com