VBA Functions

The Functions button in the "INMATION" tab of Excel allows you to call the Read and Write functions without using the Action Pane. Select a cell in the worksheet and click on Functions to show the drop-down menu.

Functions menu
Figure 1. Functions menu

Selecting ReadValue from the menu will open up a dialog where the arguments for the functions can be added. The Paths arguments can be added by selecting a range of cells from the worksheet or by entering a valid path manually. The ShowValue, ShowTimestamp and ShowQuality arguments are all boolean so TRUE or FALSE should be added.

Function Arguments
Figure 2. Function Arguments

Click OK to enter the formula and the retrieved values will be returned. The function can also be edited manually in the cell with a valid path name and arguments.

Functions - Editing cell value
Figure 3. Functions - Editing cell value
For the function to return a valid value, ALL arguments must be filled in the cell. For example the ReadValue function, all the ShowValue, ShowTimestamp and ShowQuality arguments must have a value for the function to work.

When retrieving timestamps using a Function, the cell format must be changed to display the timestamp properly. For example, using the custom format shown below.

Timestamp cell format
Figure 4. Timestamp cell format
This format should also be used for the Start and End time arguments for the history read functions.