--- sc/source/ui/vba//vbaglobals.cxx	
+++ sc/source/ui/vba//vbaglobals.cxx
@@ -32,9 +32,10 @@
  *    MA  02111-1307  USA
  *
  ************************************************************************/
-#ifndef SC_VBA_GLOBALS
+#include "helperdecl.hxx"
 #include "vbaglobals.hxx"
-#endif
+
+#include <comphelper/unwrapargs.hxx>
 
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
@@ -49,76 +50,25 @@ using namespace ::org::openoffice;
 
 
 
-namespace vbaobj
-{
-    ::rtl::OUString SAL_CALL getImplementationName()
-    {
-        static ::rtl::OUString* pImplName = 0;
-		if ( !pImplName )
-		{
-            ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-            if ( !pImplName )
-			{
-				static ::rtl::OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.vba.Globals" ) );
-				pImplName = &aImplName;
-			}
-		}
-		return *pImplName;
-    }
-
-	uno::Reference< XComponentContext > getComponentContextFromMSF( uno::Reference< lang::XMultiServiceFactory > const& xFactory )  
-	{
-		uno::Reference< XComponentContext > xContext;
-
-	        uno::Reference< beans::XPropertySet > xProps( xFactory, UNO_QUERY );
-		if (xProps.is())
-		{
-			xProps->getPropertyValue(
-			rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xContext;
-		}
-		return xContext;
-	}
-
-
-    uno::Reference< XInterface > SAL_CALL create(
-        Reference< XComponentContext > const & xContext )
-        SAL_THROW( () )
-    {
-	if ( !xContext.is() )
-	{
-		OSL_TRACE("Failed to obtain context" );	
-		return uno::Reference< uno::XInterface >(NULL);
-	}
-	OSL_TRACE("In create component for vbaglobals");
-        return static_cast< lang::XTypeProvider * >( new ScVbaGlobals( xContext ) );
-    }
-
-	Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
-	{
-    	const ::rtl::OUString strName( ::vbaobj::getImplementationName() );
-		return Sequence< ::rtl::OUString >( &strName, 1 );
-	}	
-}
-
 // =============================================================================
 // ScVbaGlobals
 // =============================================================================
 
-ScVbaGlobals::ScVbaGlobals( const Reference< XComponentContext >& rxContext )
+ScVbaGlobals::ScVbaGlobals(  css::uno::Reference< css::uno::XComponentContext >const& rxContext )
         :m_xContext( rxContext )
 {
-//	OSL_TRACE("ScVbaGlobals::ScVbaGlobals()");
+	OSL_TRACE("ScVbaGlobals::ScVbaGlobals()");
 	mxApplication = uno::Reference< excel::XApplication > ( new ScVbaApplication( m_xContext) );
 }
 
 ScVbaGlobals::~ScVbaGlobals()
 {
-//	OSL_TRACE("ScVbaGlobals::~ScVbaGlobals");
+	OSL_TRACE("ScVbaGlobals::~ScVbaGlobals");
 }
 
 // Will throw if singleton can't be accessed 
 uno::Reference< vba::XGlobals >
-ScVbaGlobals::getGlobalsImpl( uno::Reference< uno::XComponentContext >& xContext ) throw ( uno::RuntimeException )
+ScVbaGlobals::getGlobalsImpl( const uno::Reference< uno::XComponentContext >& xContext ) throw ( uno::RuntimeException )
 {
 	uno::Reference< vba::XGlobals > xGlobals( 
 		xContext->getValueByName( ::rtl::OUString::createFromAscii( 
@@ -133,31 +83,6 @@ ScVbaGlobals::getGlobalsImpl( uno::Refer
 	return xGlobals;
 }
 
-// -----------------------------------------------------------------------------
-// XServiceInfo
-// -----------------------------------------------------------------------------
-
-::rtl::OUString ScVbaGlobals::getImplementationName(  ) throw (RuntimeException)
-{
-	return ::vbaobj::getImplementationName();
-}
-
-sal_Bool ScVbaGlobals::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException)
-{
-	Sequence< ::rtl::OUString > aNames( ::vbaobj::getSupportedServiceNames() );
-	const ::rtl::OUString* pNames = aNames.getConstArray();
-	const ::rtl::OUString* pEnd = pNames + aNames.getLength();
-	for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames )
-		;
-
-	return pNames != pEnd;
-}
-
-Sequence< ::rtl::OUString > ScVbaGlobals::getSupportedServiceNames(  ) throw (RuntimeException)
-{
-	return vbaobj::getSupportedServiceNames();
-}
-	
 // =============================================================================
 // XGlobals
 // =============================================================================
@@ -232,4 +157,14 @@ ScVbaGlobals::Range( const uno::Any& Cel
 	return getApplication()->Range( Cell1, Cell2 );
 }
 
+namespace globals
+{
+namespace sdecl = comphelper::service_decl;
+sdecl::class_<ScVbaGlobals, sdecl::with_args<false> > serviceImpl;
+extern sdecl::ServiceDecl const serviceDecl(
+    serviceImpl,
+    "org.openoffice.vba.Globals",
+    "org.openoffice.vba.Globals" );
+}
+
 
