GetCellByPosition

Hello!

How do I get GCBP working? I’ve tried a few others and they look like they depend on a function that is not defined.
Anyone know of a work around?

Thanks!

  1. Get Calc document (e.g. oDoc = ThisComponent)

  2. Verify that it is Calc document (If NOT oDoc.SupportsService("com.sun.star.sheet.SpreadsheetDocument") Then Exit Sub)

  3. Get all sheets of it (oSheets = oDoc.getSheets())

  4. Get one sheet (oSheet = oSheets.getByIndex(*integer number*) or oSheet = oSheets.getByName("*string sheetName*"))

  5. And now get any cell of this sheet by index of column and number of row

(Cell = oSheet.getCellByPosition(lColumn, lRow))

See some examples in standard library Tools

You can use EasyDev too: http://easydev.readthedocs.org/en/latest/libocalc.html#cells