XCellRange testRange = oSheet.getCellRangeByName("$A$1:$g$7") ;
XSheetCellRange testSheetRange = (XSheetCellRange)
UnoRuntime.queryInterface(XSheetCellRange.class,testRange);
XSheetCellCursor oCellCursor = oSheet.createCursorByRange
(testSheetRange);
XCellCursor oCursor = (XCellCursor)
UnoRuntime.queryInterface(XCellCursor.class,oCellCursor);
boolean bResult = false;
int startCol, endCol, startRow, endRow = 0;
XCellRangeAddressable oRange = (XCellRangeAddressable)
UnoRuntime.queryInterface(XCellRangeAddressable.class, oCursor);
oCursor.gotoEnd();
CellRangeAddress oAddr = oRange.getRangeAddress();
startRow = oAddr.StartRow;
startCol = oAddr.StartColumn;
endRow = oAddr.EndRow;
endCol = oAddr.EndColumn;