Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Historian

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:

  1. Start Excel and create an AVEVA Historian Client Workbook spreadsheet.

    AVEVA Historian Client Workbook spreadsheet.

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

    Microsoft Visual Basic Editor window.

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

    VBAProject dialog box.

  4. Select the ActiveFactoryWorkbook check box.

  5. Click OK.

  6. On the Insert menu, click Module to add a new module to the project.

  7. Add a subroutine that executes the mnuConvertSheet method.

    Adding a subrutine in Microsoft Visual Basic window.

  8. Switch back to Excel.

  9. On the View menu, point to Toolbars and then click Forms to open the Forms toolbar.

    Workbook forms toolbar.

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

    Assign Macro dialog box.

  11. In the Macro name list, select ConvertToValues, which is the subroutine that you created in Step 7.

  12. Click OK.

  13. Change the display name for the button and adjust the size, appropriately.

    Workbook spreadsheet showing Convert To Values button.

  14. Click the Convert To Values button to execute the command.

  15. All of the functions in the sheet are converted to values.

    Spreadsheet with functions converted to values.

TitleResults for “How to create a CRG?”Also Available in