--- sc/source/ui/vba//vbaworksheet.cxx	
+++ sc/source/ui/vba//vbaworksheet.cxx
@@ -75,6 +75,9 @@
 #include "vbachartobjects.hxx"
 #include "vbapivottables.hxx"
 #include "vbacombobox.hxx"
+#include "vbaoleobject.hxx"
+#include "vbaoleobjects.hxx"
+#include "vbashapes.hxx"
 
 #define STANDARDWIDTH 2267 
 #define STANDARDHEIGHT 427
@@ -184,12 +187,12 @@ openNewDoc(rtl::OUString aSheetName )
 }
 
 
-ScVbaWorksheet::ScVbaWorksheet( const uno::Reference< uno::XComponentContext >& xContext ): m_xContext( xContext ) 
+ScVbaWorksheet::ScVbaWorksheet( const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext ) : WorksheetImpl_BASE( xParent, xContext )
 {
 }
-ScVbaWorksheet::ScVbaWorksheet(const uno::Reference< uno::XComponentContext >& xContext,
+ScVbaWorksheet::ScVbaWorksheet(const uno::Reference< vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext,
 		const uno::Reference< sheet::XSpreadsheet >& xSheet, 
-		const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) : m_xContext(xContext), mxSheet( xSheet ), mxModel(xModel)
+		const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) : WorksheetImpl_BASE( xParent, xContext ), mxSheet( xSheet ), mxModel(xModel)
 {
 }
 
@@ -236,14 +239,14 @@ ScVbaWorksheet::getUsedRange() throw (un
 	xUsedCursor->gotoStartOfUsedArea( false );
 	xUsedCursor->gotoEndOfUsedArea( true );
 	uno::Reference< table::XCellRange > xRange( xSheetCellCursor, uno::UNO_QUERY);
-	return new ScVbaRange(m_xContext, xRange);
+	return new ScVbaRange(this, mxContext, xRange);
 }
 
 uno::Reference< excel::XOutline >
 ScVbaWorksheet::Outline( ) throw (uno::RuntimeException)
 {
 	uno::Reference<sheet::XSheetOutline> xOutline(getSheet(),uno::UNO_QUERY_THROW);
-	return uno::Reference<excel::XOutline> (new ScVbaOutline(m_xContext, xOutline));
+	return new ScVbaOutline( this, mxContext, xOutline);
 }
 
 sal_Int32 
@@ -303,7 +306,8 @@ ScVbaWorksheet::Move( const uno::Any& Be
 		uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = getSheet()->createCursor( );
 		uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW);
         	uno::Reference< table::XCellRange > xRange1( xSheetCellCursor, uno::UNO_QUERY);
-		uno::Reference<excel::XRange> xRange =  new ScVbaRange(m_xContext, xRange1);
+		// #FIXME needs worksheet as parent
+		uno::Reference<excel::XRange> xRange =  new ScVbaRange( this, mxContext, xRange1);
 		if (xRange.is())
 			xRange->Select();
 		implnCopy();
@@ -341,7 +345,7 @@ ScVbaWorksheet::Copy( const uno::Any& Be
 		uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = getSheet()->createCursor( );
 		uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW);
         	uno::Reference< table::XCellRange > xRange1( xSheetCellCursor, uno::UNO_QUERY);
-		uno::Reference<excel::XRange> xRange =  new ScVbaRange(m_xContext, xRange1);
+		uno::Reference<excel::XRange> xRange =  new ScVbaRange( this, mxContext, xRange1);
 		if (xRange.is())
 			xRange->Select();
 		implnCopy();
@@ -413,7 +417,8 @@ ScVbaWorksheet::getSheetAtOffset(SCTAB o
 		return uno::Reference< excel::XWorksheet >(); 
 	nIdx = nIdx + offset;
 	uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(nIdx), uno::UNO_QUERY_THROW);
-	return new ScVbaWorksheet (m_xContext, xSheet, getModel());
+	// parent will be the parent of 'this' worksheet
+	return new ScVbaWorksheet (getParent(), mxContext, xSheet, getModel());
 }
 
 uno::Reference< excel::XWorksheet >
@@ -459,7 +464,7 @@ ScVbaWorksheet::Calculate() throw (uno::
 uno::Reference< excel::XRange >
 ScVbaWorksheet::Range( const ::uno::Any& Cell1, const ::uno::Any& Cell2 ) throw (uno::RuntimeException)
 {
-	uno::Reference< excel::XRange > xSheetRange( new ScVbaRange( m_xContext 
+	uno::Reference< excel::XRange > xSheetRange( new ScVbaRange( this, mxContext 
 , uno::Reference< table::XCellRange >( getSheet(), uno::UNO_QUERY_THROW ) ) );
 	return xSheetRange->Range( Cell1, Cell2 );
 }
@@ -477,7 +482,7 @@ uno::Reference< excel::XRange > 
 ScVbaWorksheet::getSheetRange() throw (uno::RuntimeException)
 {
 	uno::Reference< table::XCellRange > xRange( getSheet(),uno::UNO_QUERY_THROW );
-	return uno::Reference< excel::XRange >( new ScVbaRange( m_xContext, xRange ) );
+	return uno::Reference< excel::XRange >( new ScVbaRange( this, mxContext, xRange ) );
 }
 
 // These are hacks - we prolly (somehow) need to inherit
@@ -509,15 +514,16 @@ ScVbaWorksheet::ChartObjects( const uno:
 		uno::Reference< table::XTableChartsSupplier > xChartSupplier( getSheet(), uno::UNO_QUERY_THROW );
 		uno::Reference< table::XTableCharts > xTableCharts = xChartSupplier->getCharts();
 		
-		mxCharts = new ScVbaChartObjects( m_xContext, xTableCharts );
+		uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( mxSheet, uno::UNO_QUERY_THROW );
+		mxCharts = new ScVbaChartObjects(  this, mxContext, xTableCharts, xDrawPageSupplier );
 	}
 	if ( Index.hasValue() )
 	{
 		uno::Reference< vba::XCollection > xColl( mxCharts, uno::UNO_QUERY_THROW );
-		return xColl->Item( Index );
+		return xColl->Item( Index, uno::Any() );
 	}
 	else
-		return makeAny( mxCharts );
+		return uno::makeAny( mxCharts );
 	
 }
 
@@ -528,10 +534,10 @@ ScVbaWorksheet::PivotTables( const uno::
 	uno::Reference< sheet::XDataPilotTablesSupplier > xTables(xSheet, uno::UNO_QUERY_THROW ) ;
 	uno::Reference< container::XIndexAccess > xIndexAccess( xTables->getDataPilotTables(), uno::UNO_QUERY_THROW );
 
-	uno::Reference< vba::XCollection > xColl( uno::Reference< excel::XPivotTables > ( new ScVbaPivotTables( m_xContext, xIndexAccess ) ), uno::UNO_QUERY_THROW );
+	uno::Reference< vba::XCollection > xColl(  new ScVbaPivotTables( this, mxContext, xIndexAccess ) );
 	if ( Index.hasValue() )
-		return xColl->Item( Index );
-	return makeAny( xColl );
+		return xColl->Item( Index, uno::Any() );
+	return uno::makeAny( xColl );
 }
 
 uno::Any SAL_CALL
@@ -541,13 +547,41 @@ ScVbaWorksheet::Comments( const uno::Any
 	uno::Reference< sheet::XSheetAnnotationsSupplier > xAnnosSupp( xSheet, uno::UNO_QUERY_THROW );
 	uno::Reference< sheet::XSheetAnnotations > xAnnos( xAnnosSupp->getAnnotations(), uno::UNO_QUERY_THROW );
 	uno::Reference< container::XIndexAccess > xIndexAccess( xAnnos, uno::UNO_QUERY_THROW );
-
-	uno::Reference< vba::XCollection > xColl( uno::Reference< excel::XComments > ( new ScVbaComments( m_xContext, xIndexAccess ) ), uno::UNO_QUERY_THROW );
+	uno::Reference< vba::XCollection > xColl(  new ScVbaComments( this, mxContext, xIndexAccess ) );
 	if ( Index.hasValue() )
-		return xColl->Item( Index );
-	return makeAny( xColl );
+		return xColl->Item( Index, uno::Any() );
+	return uno::makeAny( xColl );
 }
 
+uno::Any SAL_CALL
+ScVbaWorksheet::OLEObjects( const uno::Any& Index ) throw (uno::RuntimeException)
+{
+    ScVbaOLEObjects* aOleObjects;
+    uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW );
+    uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW );
+    uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
+    uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPage, uno::UNO_QUERY_THROW );
+    aOleObjects = new ScVbaOLEObjects( this, mxContext, xIndexAccess );
+
+    if( Index.hasValue() )
+    {
+            return aOleObjects->Item( Index, uno::Any() );
+    }
+    else
+    {
+        return uno::makeAny( uno::Reference< excel::XOLEObjects> ( aOleObjects ) );
+    }
+}
+uno::Any SAL_CALL
+ScVbaWorksheet::Shapes() throw (uno::RuntimeException)
+{
+    uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW );
+    uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW );
+    uno::Reference< drawing::XShapes > xShapes( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
+    uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY_THROW );
+
+    return uno::makeAny( uno::Reference< msforms::XShapes> ( new ScVbaShapes( this, mxContext, xIndexAccess ) ) );
+}
 uno::Any SAL_CALL 
 ScVbaWorksheet::Evaluate( const ::rtl::OUString& Name ) throw (uno::RuntimeException)
 {
@@ -582,7 +616,8 @@ ScVbaWorksheet::setValue( const ::rtl::O
 uno::Any SAL_CALL 
 ScVbaWorksheet::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
 {
-	uno::Any aProp = getControl( aPropertyName );
+/*	uno::Any aProp = getControl( aPropertyName );
+
 	if ( !aProp.hasValue() )
 		throw beans::UnknownPropertyException(); // unsupported operation
 	// #TODO we need a factory here when we support
@@ -591,13 +626,19 @@ ScVbaWorksheet::getValue( const ::rtl::O
 	uno::Reference< beans::XPropertySet > xProps( aProp, uno::UNO_QUERY_THROW );	
 	const static rtl::OUString sClassId( RTL_CONSTASCII_USTRINGPARAM("ClassId") );
 	xProps->getPropertyValue( sClassId ) >>= nClassId;
+    ScVbaControlFactory controlFactory( m_xContext, xProps, xControlShape );
+    uno::Reference< vba::XControl > xControl( controlFactory.createControl( nClassId ) );
 	if ( nClassId == form::FormComponentType::COMBOBOX )
 	{
 		uno::Reference< msforms::XComboBox > xCbx( new ScVbaComboBox( m_xContext, xProps ) ); 
 		return uno::makeAny( xCbx );
 	}
-
-	return aProp;
+*/
+    uno::Reference< drawing::XControlShape > xControlShape( getControlShape( aPropertyName ), uno::UNO_QUERY_THROW );
+    ScVbaControlFactory controlFactory( mxContext, xControlShape );
+    uno::Reference< msforms::XControl > xControl( controlFactory.createControl() );
+	return uno::makeAny( xControl );
+//	return aProp;
 }
 
 ::sal_Bool SAL_CALL 
@@ -655,6 +696,46 @@ ScVbaWorksheet::getControl( const ::rtl:
 	return uno::Any();
 }
 
-
-
+uno::Any
+ScVbaWorksheet::getControlShape( const ::rtl::OUString& sName )
+{
+	//uno::Reference< sheet::XScenarioEnhanced > xIf( getSheet(), uno::UNO_QUERY_THROW );
+    uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW );
+    uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW );
+    uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
+    uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPage, uno::UNO_QUERY_THROW );
+    sal_uInt16 nCount = xIndexAccess->getCount();
+    for( int index = 0; index < nCount; index++ )
+    {
+        uno::Any aUnoObj =  xIndexAccess->getByIndex( index );
+        uno::Reference< drawing::XControlShape > xControlShape( aUnoObj, uno::UNO_QUERY_THROW );
+        uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl() );
+        uno::Reference< container::XNamed > xNamed( xControlModel, uno::UNO_QUERY_THROW );
+        if( sName.equals( xNamed->getName() ))
+        {
+            return aUnoObj;
+        }
+
+    }
+    return uno::Any();
+}
+
+rtl::OUString& 
+ScVbaWorksheet::getServiceImplName()
+{
+	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWorksheet") );
+	return sImplName;
+}
+
+uno::Sequence< rtl::OUString > 
+ScVbaWorksheet::getServiceNames()
+{
+	static uno::Sequence< rtl::OUString > aServiceNames;
+	if ( aServiceNames.getLength() == 0 )
+	{
+		aServiceNames.realloc( 1 );
+		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Worksheet" ) );
+	}
+	return aServiceNames;
+}
 
