XPropertySet docProps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xSheetDoc);
XSpreadsheets sheets = xSheetDoc.getSheets();
String[] names = sheets.getElementNames();
XDatabaseRanges dbRanges = null;
XImportable xImp = null;
try {
Object sheet = sheets.getByName(names[0]);
xImp = (XImportable) UnoRuntime.queryInterface(XImportable.class,
sheet);
dbRanges = (XDatabaseRanges) AnyConverter.toObject(
new Type(XDatabaseRanges.class),
docProps.getPropertyValue("DatabaseRanges"));
_doImport(xImp);
} catch (com.sun.star.lang.WrappedTargetException e) {
e.printStackTrace(log);
throw new StatusException("Couldn't get a property", e);
} catch (com.sun.star.beans.UnknownPropertyException e) {
e.printStackTrace(log);
throw new StatusException("Couldn't get a property", e);
} catch (com.sun.star.lang.IllegalArgumentException e) {
e.printStackTrace(log);
throw new StatusException("Couldn't get a property", e);
} catch (com.sun.star.container.NoSuchElementException e) {
e.printStackTrace(log);
throw new StatusException(
"Error getting test object from spreadsheet document", e);
}
if (dbRanges.hasByName("dbRange")) {
dbRanges.removeByName("dbRange");
}
//CellRangeAddress aRange = new CellRangeAddress((short)0, 0, 0, 0, 13);
CellRangeAddress aRange = null;