} catch (com.sun.star.lang.IllegalArgumentException iae) {
throw new StatusException("couldn't get sheet",iae);
}
xCell = oSheet.getCellByPosition(1, 0) ;
xCell.setFormula(text);
XColumnRowRange oColumnRowRange = (XColumnRowRange)
UnoRuntime.queryInterface(XColumnRowRange.class, oSheet);
XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns();
XIndexAccess oIndexAccess = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, oColumns);
XPropertySet column = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class,oIndexAccess.getByIndex(1));
column.setPropertyValue("OptimalWidth", new Boolean(true));