Automating IBM Cognos Office

Using an application programming interface (API), you can automate the refreshing or publishing of workbook, document, and presentation content. You can use a scheduling tool, such as Scheduled Task, and can process one or more workbooks, documents, or presentations.

You can use the API to create a scheduled batch program to refresh all the IBM® Cognos® Office workbooks, documents, or presentations on a daily, weekly, or monthly basis so that, as your period data changes, the affected files are kept up-to-date.

You can call the API within Microsoft Excel workbooks, Microsoft Word documents, or Microsoft PowerPoint presentations using VBA or using VBS and a command line interface. For these types of automation to work, you must register one or more macros within the workbook, document, or presentation.

When using sample macros and script files as part of your own processing functions, remember that the API is accessible only as user defined functions (UDFs) in the Microsoft Office products: Excel, Word, or PowerPoint. UDFs are functions created in Visual Basic for Applications (VBA). In this case, however, the UDFs are created within the IBM Cognos Office solution and are called from VBA.

To help you understand what is possible using this API, several samples are provided. You can use them to help you create your own solutions by

  • creating VBA macros within Excel, Word, or PowerPoint
  • passing parameters, leveraging VBS and the command line interface

In addition to these capabilities, you can schedule scripts, either ones that you create or the samples, to run as a batch process at a set time.

Before you begin

You must ask your administrator to make the sample files available to you in a location that you can access.

Procedure

  1. Refresh the IBM Cognos Office data.
  2. Import the CognosOfficeAutomationExample.bas file.
  3. Use the IBM Cognos Office API functions.
  4. Refer to the IBM Cognos Office Visual Basic (VBA and VBS) sample script files to enhance your solution.