beautypg.com

From ms office (excel), Overview – Teledyne LeCroy WaveExpert series Automation Manual User Manual

Page 23

background image

C

HAPTER

O

NE

Overview

From MS Office (Excel)

Using Automation, control of the instrument from Microsoft Excel is very similar to control from Visual Basic. This

is because the “macro language” used in the office suite is Visual Basic for Applications, a lightweight version of

Visual Basic.
The following example shows how to add a button to an Excel spreadsheet that connects to, and controls, the

instrument on which Excel is running. Note that this example was generated using Excel 2000, other versions of

Excel support similar functionality, but the specific sequence of commands may be slightly different:

1. Enable the Forms toolbar using the ViewToolbarsForms menu option.

2. Click the button icon

on the toolbar and draw a button on the spreadsheet. The button will be labeled

“Button 1” by default.

3. Right-click on the edge of the button and select Assign Macro from the drop-down menu.

4. Select

the

New

button from the Assign Macro dialog; the macro editor will appear:

5. Type the following code into the subroutine:

Set app = CreateObject("LeCroy.XStreamDSO")

app.AutoSetup
Set app = Nothing

Clicking on the newly created button will now execute this code segment, which connects to the DSO and

performs an Auto Setup.

916435 RevA

1-11