SetNamedSubStringValue ERROR / Excel VBA 追蹤

Martin Maatman


I have written a code in VBA but I get an error in this line:

btFormat.SetNamedSubStringValue "Test", "Hallo"

It can't find 'Test'. I have created a textbox in the bartender document called 'Test'.

What am I missing, doing wrong...


Sub TSC_Etiketten()
Dim BarTender As Object
Dim btApp As BarTender.Application
Dim btFormat As BarTender.Format
Set btApp = New BarTender.Application
Set btFormat = New BarTender.Format
btApp.Visible = True
btApp.Formats.Open ("C:\Users\MTC\Documents\BarTender\BarTender Documents\Document1.btw")
btFormat.SetNamedSubStringValue "Test", "Hallo"
btApp.ActiveFormat.IdenticalCopiesOfLabel = 3
btFormats = btApp.ActiveFormat.PrintOut
End Sub

1 意見

Mike Wright
評論操作 永久連結

The SetNamedSubStringValue changes the value in a Named Data Source.

You must create a Named Data source and tie your text box to the Named Data Source.

you then use SetNameSubStringValue to change the value in the Name Data Source.