How to read a value from a cell

I am new to BO SDK. can any one help me to read the values in a cell.


nagaretsaran (BOB member since 2004-08-06)

First, welcome to BOB … we hope you’ll find it a valuable resource.

Second, reading the value from a cell (in the traditional sense of a row / column spreadsheet) is not possible … directly at least. If the cell contains a named variable (a data provider object or other formula that you’ve given a name), you can read the value(s) indirectly. Given a variable named , use this:

ThisDocument.DocumentVariables("Country").Values(BoAllValues), or
ThisDocument.DocumentVariables("Country").Values(boUniqueValues)

What is returned is an array of datatype Variant, and you can use UBound() to determine the number of elements in the array, and you use an index to cycle through them. One thing to remember is that since you are not actually reading the “cell” directly, that any filters, rankings, etc. you have built (global or table) will NOT be applied.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)