Vba 在powerpoint中编辑嵌入对象

Vba 在powerpoint中编辑嵌入对象,vba,excel,powerpoint,Vba,Excel,Powerpoint,我有一个powerpoint演示文稿,其中一张幻灯片中嵌入了excel工作簿。我还有一个userform,我希望用户输入信息,我希望获取这些信息,然后用相关信息编辑excel表格 我不知道如何在powerpoint中访问excel表格,以便更改单元格的值 Sub a() Dim oSl As PowerPoint.Slide Dim oSh As PowerPoint.Shape Set oSl = ActivePresentation.Slides(1) Set oSh = oSl.Sh

我有一个powerpoint演示文稿,其中一张幻灯片中嵌入了excel工作簿。我还有一个userform,我希望用户输入信息,我希望获取这些信息,然后用相关信息编辑excel表格

我不知道如何在powerpoint中访问excel表格,以便更改单元格的值

Sub a()

Dim oSl As PowerPoint.Slide
Dim oSh As PowerPoint.Shape

Set oSl = ActivePresentation.Slides(1)

Set oSh = oSl.Shapes(1)

With oSh.OLEFormat.Object.Sheets(1)
    .Range("A1").Value = .Range("A1").Value + 1
    .Range("A2").Value = .Range("A2").Value - 1
End With

Set oSl = Nothing
Set oSh = Nothing

End Sub  

启发,我研究了几种嵌入Excel中的ppt解决方案,但都未能成功实现任何功能。没有帮助。@Mike好的。我会试着把这些东西放在一起,然后编辑答案。