importClass(Packages.com.sun.star.uno.UnoRuntime);
importClass(Packages.com.sun.star.sheet.XSpreadsheetDocument);
importClass(Packages.com.sun.star.container.XIndexAccess);
importClass(Packages.com.sun.star.table.XCellRange);
importClass(Packages.com.sun.star.table.XCell);

oDoc = XSCRIPTCONTEXT.getDocument();
xSDoc = UnoRuntime.queryInterface(XSpreadsheetDocument, oDoc);
xSheetsIndexAccess = UnoRuntime.queryInterface(XIndexAccess, xSDoc.getSheets());

xSheet = xSheetsIndexAccess.getByIndex(0);
xCll = UnoRuntime.queryInterface(XCellRange, xSheet);

xCell_A0 = xCll.getCellByPosition(0,0);
xVar_A0 = UnoRuntime.queryInterface(XCell, xCell_A0);

xVar_A0.setFormula("Hello World (in JavaScript/ACell)")
