cell attributes backgroundcolor optimal width Tom Schindl How can I modify cell-attributes

e.g. set the background-color, set the width to optimal value

try { XCellRange range = xSpreadSheet_.getCellRangeByPosition(0,1,17,1); XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, range); xPropSet.setPropertyValue("CharWeight", new Double(FontWeight.BOLD)); xPropSet.setPropertyValue("CellBackColor", new Integer(0xAAAAAA)); xPropSet.setPropertyValue("HoriJustify", CellHoriJustify.LEFT); XColumnRowRange xColRange = (XColumnRowRange)UnoRuntime.queryInterface(XColumnRowRange.class,range); XEnumerationAccess xEnumAccess = (XEnumerationAccess)UnoRuntime.queryInterface(XEnumerationAccess.class,xColRange.getColumns()); XEnumeration xEnum = xEnumAccess.createEnumeration(); Object tableColumnService; while( xEnum.hasMoreElements() ) { tableColumnService = xEnum.nextElement(); xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, tableColumnService); xPropSet.setPropertyValue("OptimalWidth",new Boolean(true)); } } catch( Exception e) { e.printStackTrace(); } Initial version