Michael Hinz
How can i change cell attributes
/* get the desktop (an Xdesktop object) */
oDesktop = UNO.createDesktop()
xComponentLoader = oDesktop~{%see com.sun.star.frame.XDesktop%XDesktop}~{%see com.sun.star.frame.XComponentLoader%XComponentLoader} --get componentLoader interface
/* open a blank calc file */
url = "private:factory/scalc"
xCalcComponent = xComponentLoader~loadComponentFromURL(url, "_blank", 0, .UNO~noProps)
/* get first sheet in spreadsheet */
xDocument = xCalcComponent~{%see com.sun.star.sheet.XSpreadsheetDocument%XSpreadSheetDocument}
xSheet = xDocument~getSheets~{%see com.sun.star.container.XIndexAccess%XIndexAccess}~getByIndex(0)~{%see com.sun.star.sheet.XSpreadsheet%XSpreadSheet}
/* get cell address */
xCell = xSheet~getCellByPosition(0, 0)
xCell2 = xSheet~getCellByPosition(0, 1)
/* set cell properties */
xCell~{%see com.sun.star.beans.XPropertySet%xPropertySet}~setPropertyValue("CharWeight", box("float",bsf.getConstant("{%see com.sun.star.awt.FontWeight}", "BOLD")))
xCell2~{%see com.sun.star.beans.XPropertySet%xPropertySet}~setPropertyValue("CellBackColor", box("int", "CCCCCC"x ~c2d))
/* insert values into cells */
CALL UNO.setCell xSheet, 0, 0, "CharWeight"
CALL UNO.setCell xSheet, 0, 1, "CellBackColor"
::requires UNO.cls -- get UNO support