summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbaworkbook.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/vba/vbaworkbook.cxx')
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 1e2acd6252b8..e0d50c592e6c 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -218,14 +218,9 @@ ScVbaWorkbook::getActiveSheet() throw (uno::RuntimeException)
{
uno::Reference< frame::XModel > xModel( getCurrentExcelDoc( mxContext ), uno::UNO_SET_THROW );
uno::Reference< sheet::XSpreadsheetView > xView( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xSheetProps( xView->getActiveSheet(), uno::UNO_QUERY_THROW );
- // #162503# return the original document module wrapper object, instead of a new instance
- ::rtl::OUString aCodeName;
- xSheetProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_CODENAME ) ) ) >>= aCodeName;
- ScDocShell* pShell = excel::getDocShell( xModel );
- if( !pShell )
- throw uno::RuntimeException();
- return uno::Reference< excel::XWorksheet >( getUnoDocModule( aCodeName, pShell ), uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XSpreadsheet > xSheet( xView->getActiveSheet(), uno::UNO_SET_THROW );
+ // #162503# return the original sheet module wrapper object, instead of a new instance
+ return uno::Reference< excel::XWorksheet >( excel::getUnoSheetModuleObj( xSheet ), uno::UNO_QUERY_THROW );
}
uno::Any SAL_CALL