// we need to distinguish text and sheet tables:
// property name for cell colors is different in text and sheet cells
// we want to apply TableBorder to whole text table, but only to sheet cells with content
XServiceInfo xServiceInfo = (XServiceInfo)UnoRuntime.queryInterface(
XServiceInfo.class, xCellRange);
if (xServiceInfo.supportsService("com.sun.star.sheet.Spreadsheet")) {
backColorPropertyName = "CellBackColor";
xSelectedCells = xCellRange.getCellRangeByName("A1:B2");
xTableProps = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xSelectedCells);
}