Zum Hauptinhalt gehen

Suche

Suche

Print From Vba

Kommentare

10 Kommentare

  • Avatar
    Ian Cummings
    Moderator

    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
  • Avatar
    Legacy Poster

    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
  • Avatar
    Ian Cummings
    Moderator

    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
  • Avatar
    Legacy Poster

    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
  • Avatar
    Ian Cummings
    Moderator

    I suggest you attach your BarTender document and paste in the relevant section of code for us to take a look at.

    0
  • Avatar
    Legacy Poster
    Sub test()
     
    Dim btApp As BarTender.Application
    Dim btFormat As BarTender.Format
    Dim btSubString As BarTender.SubString
     
     
     
        Set btApp = New BarTender.Application
        Set btFormat = New BarTender.Format
        btApp.Formats.Open ("f:\labels\new breakout tags\breakouts.btw")
        btApp.Visible = True
        
        'Select the data source
    btSubString = btFormat.NamedSubStrings.GetSubString(1)
     
    'Show the data source's name
    MessageBox.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 Hurst
     
     
     
    Dim btApp As BarTender.Application
    Dim btFormat As BarTender.Format
        
     
     
    'Open Bartender and Print
     
        Set btApp = New BarTender.Application
        Set btFormat = New BarTender.Format
        btApp.Formats.Open ("f:\labels\new breakout tags\breakouts.btw")
        btApp.Visible = True
        
       
       btFormat.SetNamedSubStringValue "Part", "7"
     
       ' btApp.ActiveFormat.IdenticalCopiesOfLabel = 1
        btFormats = btApp.ActiveFormat.PrintOut(False, False)
     
     
     
     
     
     
    End Sub
     
    0
  • Avatar
    Legacy Poster

    I tried changing the field to a globalitem.  I'm able to update the field, however, Bartender freezes while trying to print.

    0
  • Avatar
    Legacy Poster

    For anyone who may read this, since Bartender never gave me an answer, here is what I found finally worked:

     

     

    Set btApp = New BarTender.Application
         Set btFormat = btApp.Formats.Open("c:\bartenderfile.btw")
         btApp.Visible = False
         btFormat.SetNamedSubStringValue "Part", Filename
       
      Filename is a variable declared earlier in my code.
    0
  • Avatar
    Nishan Amarasingha

    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
  • Avatar
    Ian Cummings
    Moderator

    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.