Modify powerpoint embedded worksheetobject sheet data from excel

JohnWood

New Member
Joined
Dec 2, 2014
Messages
28
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
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
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,224,828
Messages
6,181,210
Members
453,023
Latest member
alabaz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top