AVEVA Historian Client Workbook automation example
- Last UpdatedFeb 28, 2025
- 2 minute read
The following example illustrates how to automate the AVEVA Historian Client Workbook within Visual Basic for Applications (VBA). In this example, a button is added to the workbook that can be used to convert all of the functions in the sheet to values. This example uses the ActiveFactoryWorkbook.mnuConvertSheet method.
To automate the AVEVA Historian Client Workbook:
-
Start Excel and create an AVEVA Historian Client Workbook spreadsheet.

-
On the Tools menu, point to Macro and then click Visual Basic Editor. The Microsoft Visual Basic editor appears.

-
On the Tools menu, click References. The References - VBAProject dialog box appears.

-
Select the ActiveFactoryWorkbook check box.
-
Click OK.
-
On the Insert menu, click Module to add a new module to the project.
-
Add a subroutine that executes the mnuConvertSheet method.

-
Switch back to Excel.
-
On the View menu, point to Toolbars and then click Forms to open the Forms toolbar.

-
Insert a button into the worksheet. The Assign Macro dialog box appears.

-
In the Macro name list, select ConvertToValues, which is the subroutine that you created in Step 7.
-
Click OK.
-
Change the display name for the button and adjust the size, appropriately.

-
Click the Convert To Values button to execute the command.
-
All of the functions in the sheet are converted to values.
