我有一个 Powerpoint 演示文稿,其中一张幻灯片中嵌入了 Excel 工作簿。我还有一个用户表单,我希望用户在其中输入信息,我想获取此信息,然后使用相关信息编辑 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
灵感来自 this code
关于vba - 在 powerpoint 中编辑嵌入对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4528053/