Book Image

Learn OpenOffice.org Spreadsheet Macro Programming: OOoBasic and Calc automation

By : Dr Mark Alexander Bain
Book Image

Learn OpenOffice.org Spreadsheet Macro Programming: OOoBasic and Calc automation

By: Dr Mark Alexander Bain

Overview of this book

<p>Adding macros to your spreadsheets enables you to add data processing features to your work, automate repetitive tasks, and even create complete data-driven programs that use the spreadsheet as their back end.<br /><br />This book teaches the OOoBasic language and the Calc object model, so that you can manipulate spreadsheets and data from within your programs. You will also see how to create dialog boxes and windows for friendly user interfaces, and how to integrate your spreadsheets with other applications, for example writing spreadsheet data to a document, or capturing data from a database, and using the spreadsheet for generating advanced calculations and reports.<br /><br />Calc is OpenOffice.org's spreadsheet module. Like the rest of OpenOffice.org Calc can be programmed using the built-in language OOoBasic. Both simple macros and complex applications can be developed in this language by controlling Calc through its object model. The book is compatible with the commercial version of OpenOffice.org, StarOffice, and the StarBasic language.</p>
Table of Contents (15 chapters)
Learn OpenOffice.org Spreadsheet Macro Programming
Credits
About the Author
About the Reviewer
Preface

Overview of the OOo Object Model


We've already learned that we're going to be working with UNOs—OpenOffice.org's Universal Network Objects—and to understand them better, we're actually going to start at the bottom and work our way upwards.

At its simplest level, we've got a client (your macro) that interfaces with, well, with an interface:

The Interface

Each interface is simply made up of a set of one or more methods, and you can use these methods to:

  • Get or set parameters

  • Control the operation of any functionality that the interface defines

Every interface is contained in a service.

The Service

A service is a UNO component—the building block of OOo Calc. Each service consists of one or more interfaces and it has a set of types associated with it (and yes, you would be right it thinking that the interface is a type as well):

You'll find that there are four types associated with the services:

  • Constants

  • Enums

  • Exceptions

  • Structs

It'll be obvious to you what three of the property types are used...