Print From Vba
I want to update a text box in Bartender from excel. The textbox has a shared name of "Part". I'm running this code from vba in excel:
btFormat.SetNamedSubStringValue "part", "5"
I get an error saying that "part" is not a named data source.
Help...
-
Did you set the name of the data source itself, or the name of the label object? It needs to be a name of the data source, which by default is blank.
0 -
In the Text Properties under the Data Source tab, I changed the "Name:" Field to "Part". The type is Embedded Data. I'm getting the same error today.
0 -
Have you tried using parenthesis?
btFormat.SetNamedSubStringValue("Part", "5")
In fault finding, use the GetSubString() call to iterate through all sub-strings in the document. I guess this will help to uncover where you're going wrong.
'Select the data source
btSubString = btFormat.NamedSubStrings.GetSubString(1)
'Show the data source's name
MessageBox.Show(btSubString.Name)
0 -
If I use the parenthesis I get:
Compile Error:
Expected: =
I tried the code you suggested.
I get this:
The named data source 1 is not found in the named data source list.
0 -
I suggest you attach your BarTender document and paste in the relevant section of code for us to take a look at.
0 -
Sub test()Dim btApp As BarTender.ApplicationDim btFormat As BarTender.FormatDim btSubString As BarTender.SubStringSet btApp = New BarTender.ApplicationSet btFormat = New BarTender.FormatbtApp.Formats.Open ("f:\labels\new breakout tags\breakouts.btw")btApp.Visible = True'Select the data sourcebtSubString = btFormat.NamedSubStrings.GetSubString(1)'Show the data source's nameMessageBox.Show (btSubString.Name)End Sub--------------------------------------------------------------------------------------------------------Here is the actual section of bartender code I'm working on:Sub macro_breakoutlabel()'-4/1/15 Change from commander to direct from excel. Brandon HurstDim btApp As BarTender.ApplicationDim btFormat As BarTender.Format'Open Bartender and PrintSet btApp = New BarTender.ApplicationSet btFormat = New BarTender.FormatbtApp.Formats.Open ("f:\labels\new breakout tags\breakouts.btw")btApp.Visible = TruebtFormat.SetNamedSubStringValue "Part", "7"' btApp.ActiveFormat.IdenticalCopiesOfLabel = 1btFormats = btApp.ActiveFormat.PrintOut(False, False)End Sub0
-
I tried changing the field to a globalitem. I'm able to update the field, however, Bartender freezes while trying to print.
0 -
For anyone who may read this, since Bartender never gave me an answer, here is what I found finally worked:
Set btApp = New BarTender.ApplicationSet btFormat = btApp.Formats.Open("c:\bartenderfile.btw")btApp.Visible = FalsebtFormat.SetNamedSubStringValue "Part", FilenameFilename is a variable declared earlier in my code.0 -
Dera All we have display to below error "Run-time Error '429': ActiveX Component cant't create Object" please help to clear about matter ...
Object code
Set btApp = New BarTender.Application
0 -
Could be any one of a number of different causes, such as BarTender not being installed, activated, or of a sufficient edition to support automation. There are other possibilities also.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
10 Kommentare