Print a trend chart from a button using VBA
Print a trend chart from a button using VBA.
To print a trend chart 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 selectPrintChart.Trend1.PrintChart
- Press the space key and then selectTrue, orFalsefor the UsePortraitMode parameter.Private Sub Button1_Released()Trend1.PrintChart TrueEnd Sub
- Press the comma key and then selectTrue, orFalsefor the ShowPrinterSelection parameter.Private Sub Button1_Released()Trend1.PrintChart True, FalseEnd Sub
- Test the display.
Provide Feedback