} catch(com.sun.star.beans.UnknownPropertyException e){
e.printStackTrace(log);
throw new StatusException("Couldn't get NamedRanges", e);
}
XNamedRanges xNamedRanges = (XNamedRanges)
UnoRuntime.queryInterface(XNamedRanges.class, ranges);
CellRangeAddress DataArea = new CellRangeAddress((short)0, 0, 0, 1, 1);
CellAddress base = new CellAddress(DataArea.Sheet,
DataArea.StartColumn,
DataArea.StartRow);
if (xNamedRanges.hasByName("ANamedRange")) {
xNamedRanges.removeByName("ANamedRange");
}
xNamedRanges.addNewByName("ANamedRange", "A1:B2", base, 0);
CellAddress listOutputPosition = new CellAddress((short)0, 1, 1);
xNamedRanges.outputList(listOutputPosition);
try {
oObj = (XInterface) AnyConverter.toObject(
new Type(XInterface.class),xNamedRanges.getByName("ANamedRange"));
} catch(com.sun.star.lang.WrappedTargetException e){
e.printStackTrace(log);
throw new StatusException("Couldn't get by name", e);
} catch(com.sun.star.container.NoSuchElementException e){
e.printStackTrace(log);