5 Application Programs 
Example Program for Excel 5.0 (Windows 3.1 and GPIB)
144 E3632A User’s Guide
Example Program for Excel 5.0 (Windows 3.1 and GPIB)
Excel VB Macros may be used to control your Keysight 
E3632A. With Excel you can take the value of a cell in a 
spread sheet, send it to the power supply, and then record 
the response on the worksheet. The example on the 
following pages characterizes a component across the 
Keysight E3632A terminals. This example reads 11 voltages 
from a worksheet, programs the Keysight E3632A to that 
voltage, and then reads the current. The value of current is 
recorded next to the voltage on the spread sheet. The 
example is for Excel 5.0 in Windows 3.1.
To write macros and control the power supply in Excel first 
open a module in Excel. From the Insert menu choose Macro 
and then Module. Name the module created this way Diode 
bas (click the right mouse button on the tab). Create one 
more module named GPIB bas. The module GPIB bas will 
set up all the overhead needed to talk to the GPIB port. This 
module will subroutines that allow the communication in a 
simple form.  The macro called Diode is an example that 
tests a diode using the other module.
To try the example for characterizing a diode, type in both 
modules. Once the modules are completed, go to a 
worksheet. In cell A4 type Volts, in cell B4 type Current. 
In cells A5 type 0.6. Fill in the cells A4 to A15 in 0.02 
increments so that cell A15 contains 0.8.
Now while the cursor is still in the worksheet, select Tools, 
Macro from the menu. Double click on the Diode macro in 
the  Macro dialog box. The power supply will reset to power 
on condition and then step through the voltages in the 
worksheet. After each step the current is measured, and 
recorded in the worksheet.
Make any changes to suit your needs in the Diode bas 
module. Change the GPIB address in the routine 
OpenPort( ) contained in the GPIB bas module. If there is a 
system error when trying to run the macro, you may have to 
reboot the PC for the GPIB port to work.