xEx.setSourceDocument(xSheetDoc);
//set some settings
XModel xSheetModel = (XModel)
UnoRuntime.queryInterface(XModel.class, xSheetDoc);
XController xController = xSheetModel.getCurrentController();
XPropertySet xPropSet = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, xController);
xPropSet.setPropertyValue("ShowGrid", "false");
util.CalcTools.fillCalcSheetWithContent(xSheetDoc,1, 3, 3, 50, 50);