Chapter 6 265
Creating Reports Easily Using ActiveX
Creating an Agilent VEE to MS Excel Template
You can re-use this program as a template for displaying test results in MS
Excel. You simply put the test data into arrays and modify the rest of the
template to fill in the appropriate cells in the right format.
To find additional methods and properties in the MS Excel library, look at
the
Function & Object Browser and choose the ActiveX Objects
under
Type and Excel under Library. You can choose a Class or
Member and press Help to get Help provided by the Automation Server
author (in this case, Microsoft). For more complete information on these
libraries, consult Microsoft documentation.
On Your Own
Generate a waveform and strip out the Time Span to get an array. Create a
VEE object for MS Excel with a worksheet and set it to an
Object variable.
Make the application visible. Then put the 256 point array into the
worksheet range
"A1:A256" in one step, instead of one cell at a time.
HINTS: Use an
Unbuild Waveform object. Use the [a] build array
syntax to create a 2D array from a 1D array. Then call the function
transpose() to make it a 256 x 1 array instead of a 1 x 256 array for Excel
to accept it in one step, as shown in Figure 6-12.
Figure 6-12. Program for On Your Own Exercise