xDesktop=uno.createDesktop()
xcl=xDesktop~XComponentLoader
uri="private:factory/scalc"
doc=xcl~loadComponentFromURL(uri,"_blank",0,.uno~noProps)

xSheets=doc~XSpreadSheetDocument~getSheets~XIndexAccess
xSheet =xSheets~getByIndex(0)~XSpreadSheet

call uno.setCell xSheet, "C1", "Ausgaben"
Do i=1 to 4
call uno.setCell xSheet, 1, i, "Quartal"i
end
call uno.setCell xSheet, "B6", "Summe"

Quartal1= 100000
Quartal2= 2000
Quartal3= 25681
Quartal4= 24894
call uno.setCell xSheet, "C2", Quartal1
call uno.setCell xSheet, "C3", Quartal2
call uno.setCell xSheet, "C4", Quartal3
call uno.setCell xSheet, "C5", Quartal4

Summe = Quartal1 + Quartal2 + Quartal3 + Quartal4
call uno.setCell xSheet, 2, 5, Summe

ZelleAusgaben=xSheet~getCellByPosition(2,0)
gelb=box("int", "FF FF 00"x ~c2d)
ZelleAusgaben~XPropertySet~setPropertyValue("CellBackColor", gelb)

ZelleAusgabenformat=xSheet~XCellRange~getCellRangeByName("C1:C1")~XPropertySet
fontWeight=.uno_constants~new("com.sun.star.awt.FontWeight")
ZelleAusgabenformat~setPropertyValue("CharWeight", fontWeight~bold)

ZelleSummeformat=xSheet~XCellRange~getCellRangeByName("C6:C6")~XPropertySet
fontWeight=.uno_constants~new("com.sun.star.awt.FontWeight")
ZelleSummeformat~setPropertyValue("CharWeight", fontWeight~bold)


props=xSheet~XCellRange~getCellRangeByName("B2:B6")~XPropertySet
fontWeight=.uno_constants~new("com.sun.star.awt.FontWeight")
props~setPropertyValue("CharWeight", fontWeight~bold)
props~XPropertySet~setPropertyValue("CellBackColor", gelb)

props=xSheet~XCellRange~getCellRangeByName("C2:C6")~XPropertySet
grau=box("int", "F0 F0 F8"x ~c2d)
props~XPropertySet~setPropertyValue("CellBackColor", grau)


doc~XModifiable~setModified(.false)
call SysSleep 3
doc~XCloseable~close(.false)

::requires UNO.CLS