Hello all,
I've tried a couple of hours to open an powerpoint worksheet embedded object sheet in order to modify its value from excel vba. I keep getting "type mismatch" at workbbok setting or error 438 when i set the excel workbook as object.object.( i have no problem with embedded charts, only with embedded worksheets..)
Any advice will be kindly received, thanks
I've tried a couple of hours to open an powerpoint worksheet embedded object sheet in order to modify its value from excel vba. I keep getting "type mismatch" at workbbok setting or error 438 when i set the excel workbook as object.object.( i have no problem with embedded charts, only with embedded worksheets..)
Any advice will be kindly received, thanks
VBA Code:
Private Sub initializare_Click()
Dim wb As Workbook
Dim ws As Worksheet
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Dim ppt As PowerPoint.Application
Dim pres As PowerPoint.Presentation
Dim sld As PowerPoint.Slide
Dim shp As PowerPoint.shape
Dim cht As PowerPoint.Chart
Dim chtData As PowerPoint.ChartData
Dim cTable As Excel.ListObject
Set ppt = GetObject(, "PowerPoint.Application")
Set pres = ppt.Presentations(1)
Set sld = pres.Slides(21)
For Each shp In sld.Shapes
If shp.Type = msoEmbeddedOLEObject Then
MsgBox shp.Name
shp.OLEFormat.DoVerb
'Here i keep getting the errors
Set xlWB = shp.OLEFormat.Object.Object
AppActivate Application.Caption
Set xlApp = xlWB.Parent
Set xlSH = xlApp.ActiveSheet
MsgBox xlSH.Name
xlWB.Close
End If
Next
End Sub