Setting up for the API
Before you can use the IBM Cognos automation API, you need to add a reference, which connects to IBM Cognos automation. You need to open the Visual Basic Editor, add a reference to IBM Cognos automation, and then access the IBM Cognos automation API.
Adjusting the Trust Center settings
Some settings in the Microsoft Excel Trust Center may need to be
adjusted in order to use the IBM Cognos automation API.
Procedure
- Open a new Microsoft Excel workbook.
- Click .
- Select Enable all macros and enable Trust access to the
VBA project object model.
- Click OK
Results
Note: Remain on the Options dialog as
you'll need it for the next step.
Opening the Visual Basic Editor
IBM Cognos automation and the IBM Cognos automation API functions are called by using
macros in VBA. The following steps show you how you can open the Visual Basic
Editor and start by using VBA macros.
Procedure
- From the Options dialog box, click Customize Ribbon.
- If it is not already, select the check box for the Developer tab,
in the Main Tabs pane.
- Click OK. A new tab titled DEVELOPER is shown in the Microsoft Excel ribbon.
- Click .
Results
Adding a reference to IBM Cognos automation and accessing the IBM Cognos automation API
Now that you have the Visual Basic Editor open, you can establish
a reference to IBM Cognos automation and access the IBM Cognos automation API.
Procedure
- Right-click VBAProject and then click Import
File....
- Browse to the IBM Planning Analytics for Microsoft Excel installation directory.
- Download these macro files.
- Highlight CognosOfficeAutomationExample.bas and click
Open.
- Repeat steps 1-3.
- Highlight CognosOfficeMessageSuppressor.cls and click Open.
- Close the Visual Basic Editor.
- Save the workbook as an Excel Macro-Enabled Template.