Code: Select all
importClass(Packages.com.sun.star.uno.UnoRuntime);
importClass(Packages.com.sun.star.sheet.XSpreadsheet);
importClass(Packages.com.sun.star.table.CellContentType);
importClass(Packages.com.sun.star.frame.XModel);
oDoc = UnoRuntime.queryInterface(XModel,XSCRIPTCONTEXT.getInvocationContext());
if ( !oDoc )
oDoc = XSCRIPTCONTEXT.getDocument();
xSpread = UnoRuntime.queryInterface(XSpreadsheetDocument,oDoc);
xCell = xSpread.getCellRangeByName("E2");
xCell.Value(34););
- Which interface to import for the cells, and the cells content?
- XSpreadSheet seems to not be correctly instantiated.
- How to instantiate the cell, is a Shee/Row/Range needed for that, or will getDocument() already instantiate everything (sheet, cell)?
- How to get current cell location.
Update Been looking around this examples these examples. But still no luck on trying to fit them into the code. So far XSpreadSheet and XCelllRange are there but not correctly declared.