
This chapter describes how to run tasks from within Visual Basic for Applications.
There are two ways to execute DAQ Add-In functions in a VBA module.
1. Indirectly, you can use Application.Run
returnValue=Application.Run(“FuncName”, arg1)
Application.Run “FuncName”, arg1
2. Directly, after you add a reference to the DAQ Add-In. To add a reference to the
DAQ Add-In, select Tools»References and select the checkbox next to the Data
Acquisition Add-In.
returnValue = FuncName(arg1)
FuncName arg1
Function Reference
The DAQ Add-In has one function that you can call to run a task that has been
configured already and one function to translate an error code to an error description.
DAQ
Runs the task named TaskName.
Syntax Function DAQ(TaskName as String, [NewTargetRange as String],
[ReferenceStyle as Variant]) as Integer