--- sc/source/ui/vba//vbaworkbooks.cxx	
+++ sc/source/ui/vba//vbaworkbooks.cxx
@@ -83,8 +83,8 @@ getWorkbook( uno::Reference< uno::XCompo
 	uno::Reference< frame::XModel > xModel( xDoc, uno::UNO_QUERY );
 	if( !xModel.is() )
 		return uno::Any();
-
-	ScVbaWorkbook *pWb = new ScVbaWorkbook( xContext, xModel );
+	
+	ScVbaWorkbook *pWb = new ScVbaWorkbook(  uno::Reference< vba::XHelperInterface >( ScVbaGlobals::getGlobalsImpl( xContext )->getApplication(), uno::UNO_QUERY_THROW ), xContext, xModel );
 	return uno::Any( uno::Reference< excel::XWorkbook > (pWb) );
 }
 
@@ -241,7 +241,7 @@ public:	
 
 };
 
-ScVbaWorkbooks::ScVbaWorkbooks( const uno::Reference< css::uno::XComponentContext >& xContext ) : ScVbaWorkbooks_BASE( xContext, uno::Reference< container::XIndexAccess >( new WorkBooksAccessImpl( xContext ) ) )
+ScVbaWorkbooks::ScVbaWorkbooks( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext >& xContext ) : ScVbaWorkbooks_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new WorkBooksAccessImpl( xContext ) ) )
 {
 }
 // XEnumerationAccess
@@ -257,14 +257,14 @@ ScVbaWorkbooks::createEnumeration() thro
 	// the state of this object ( although it should ) would be 
 	// safer to create an enumeration based on this objects state
 	// rather than one effectively based of the desktop component
-	return new WorkBookEnumImpl( m_xContext, uno::Reference< container::XEnumeration >( new SpreadSheetDocEnumImpl(m_xContext) ) );
+	return new WorkBookEnumImpl( mxContext, uno::Reference< container::XEnumeration >( new SpreadSheetDocEnumImpl(mxContext) ) );
 }
 
 uno::Any
 ScVbaWorkbooks::createCollectionObject( const css::uno::Any& aSource )
 {
 	uno::Reference< sheet::XSpreadsheetDocument > xDoc( aSource, uno::UNO_QUERY );
-	return getWorkbook( m_xContext, xDoc );
+	return getWorkbook( mxContext, xDoc );
 }
 
 
@@ -272,12 +272,12 @@ uno::Any SAL_CALL
 ScVbaWorkbooks::Add() throw (uno::RuntimeException)
 {
 	uno::Reference< lang::XMultiComponentFactory > xSMgr(
-        m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
+        mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
 
 	 uno::Reference< frame::XComponentLoader > xLoader(
         xSMgr->createInstanceWithContext(
             ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"),
-                m_xContext), uno::UNO_QUERY_THROW );
+                mxContext), uno::UNO_QUERY_THROW );
 	uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL(
 									   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("private:factory/scalc") ),
 									   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0, 
@@ -285,7 +285,7 @@ ScVbaWorkbooks::Add() throw (uno::Runtim
     uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( xComponent, uno::UNO_QUERY_THROW );
                                                                                                                              
     if( xSpreadDoc.is() )
-        return getWorkbook( m_xContext, xSpreadDoc );
+        return getWorkbook( mxContext, xSpreadDoc );
     return uno::Any();
 }
 
@@ -293,7 +293,7 @@ void
 ScVbaWorkbooks::Close() throw (uno::RuntimeException)
 {
 	uno::Reference< lang::XMultiComponentFactory > xSMgr(
-		m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
+		mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
 	uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
 	rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CloseDoc"));
 	dispatchRequests(xModel,url);
@@ -302,7 +302,7 @@ ScVbaWorkbooks::Close() throw (uno::Runt
 bool 
 ScVbaWorkbooks::isTextFile( const rtl::OUString& rFileName )
 {
-	uno::Reference< document::XTypeDetection > xTypeDetect( m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection"), m_xContext), uno::UNO_QUERY_THROW );
+	uno::Reference< document::XTypeDetection > xTypeDetect( mxContext->getServiceManager()->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection"), mxContext), uno::UNO_QUERY_THROW );
 	uno::Sequence< beans::PropertyValue > aMediaDesc(1);
 	aMediaDesc[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ("URL" ) );
 	aMediaDesc[ 0 ].Value <<= rFileName;
@@ -319,15 +319,15 @@ ScVbaWorkbooks::Open( const rtl::OUStrin
         rtl::OUString aURL;
         osl::FileBase::getFileURLFromSystemPath( rFileName, aURL );
 	uno::Reference< lang::XMultiComponentFactory > xSMgr(
-        	m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
+        	mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
 
 	uno::Reference< frame::XDesktop > xDesktop
-		(xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")                    , m_xContext),
+		(xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")                    , mxContext),
 		uno::UNO_QUERY_THROW );
 	uno::Reference< frame::XComponentLoader > xLoader(
 		xSMgr->createInstanceWithContext(
 		::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"),
-		m_xContext),
+		mxContext),
 		uno::UNO_QUERY_THROW );
 	uno::Sequence< beans::PropertyValue > sProps(0);
 	sal_Int32 nIndex = 0;
@@ -402,7 +402,24 @@ ScVbaWorkbooks::Open( const rtl::OUStrin
 		frame::FrameSearchFlag::CREATE,
 		sProps);
 	uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( xComponent, uno::UNO_QUERY_THROW );
-	return getWorkbook( m_xContext, xSpreadDoc );
+	return getWorkbook( mxContext, xSpreadDoc );
 }
 
+rtl::OUString& 
+ScVbaWorkbooks::getServiceImplName()
+{
+	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWorkbooks") );
+	return sImplName;
+}
 
+css::uno::Sequence<rtl::OUString> 
+ScVbaWorkbooks::getServiceNames()
+{
+	static uno::Sequence< rtl::OUString > sNames;
+	if ( sNames.getLength() == 0 )
+	{
+		sNames.realloc( 1 );
+		sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Workbooks") );
+	}
+	return sNames;
+}
