Load a trend template from a button using VBA

If you are setting up many buttons on a display, use the VBA option to help your application run faster.
To load a trend template from a button using VBA:
  1. Add a button to a graphic display, and then click
    OK
    .
  2. Right-click the trend object, and then select
    VBA code
    .
  3. Return to
    FactoryTalk View Studio
    , right-click the button object, and then select
    VBA code
    .
  4. Type the name of the Trend object in the button released event code area.
    Private Sub Button1_Released()
    Trend1
    End Sub
  5. Press the period key, and then select
    Load Template
    from the list.
    Trend1.LoadTemplate
  6. Type the name of the template in quotes.
    Private Sub Button1_Released()
    Trend1.LoadTemplate "Template1"
    End Sub
  7. Test the display.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal