Skip to content

Calling Excel API Functions

duncanwerner edited this page Jun 30, 2014 · 10 revisions

BERT is an XLL Excel Add-in, which means it can use the Excel C API. This is a powerful, and potentially dangerous, way to interact with Excel. It is generally faster than using COM (like VBA) because it does not have any abstraction.

BERT installs a function which wraps the Excel API callback function. It also installs a wrapper class for the Excel Reference type, which can be useful when working with the Excel API. When R code calls the Excel callback function, any Excel references are returned as the xlRefClass type. Similarly if you pass this class to the Excel function, BERT will construct Excel References.

The file ExcelFunctions.R included in the BERT install directory includes a number of helper functions which call various Excel functions. These should be easier to use than using the Excel API directly.

Clone this wiki locally