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:
- Add a button to a graphic display, and then clickOK.
- Right-click the trend object, and then selectVBA code.
- Return toFactoryTalk View Studio, right-click the button object, and then selectVBA code.
- Type the name of the Trend object in the button released event code area.Private Sub Button1_Released()Trend1End Sub
- Press the period key, and then selectLoad Templatefrom the list.Trend1.LoadTemplate
- Type the name of the template in quotes.Private Sub Button1_Released()Trend1.LoadTemplate "Template1"End Sub
- Test the display.
Provide Feedback