将 OLEObject 从 Excel 复制到新创建的 Powerpoint
即使经过数小时的搜索,我仍很难正确使用 API。
基本上,我想从 Excel 文件执行以下操作。
1) 创建一个新的 Powerpoint 演示文稿和幻灯片。 [完成]
2) 将 OLEObject 从 Excel 文件复制到 Powerpoint 幻灯片中。
到目前为止我为没有做过什么。 2 是
Dim s As Shapes
For Each Obj in Worksheets("TEMPLATE").OLEObjects
'Copy OLEObjects from Excel to Powerpoint slide
Set s = pptSlide.Shapes.AddOLEObject '( ... ?? ... )
Next Obj
请帮助我了解如何将 OLEObjects 从 Excel 文件复制到 Powerpoint 幻灯片中。
谢谢 。
I'm struggling to get the API usage correct, even after hours of searching.
Basically, I want to do the following from my Excel file.
1) Create a new Powerpoint presentation and slide. [DONE]
2) Copy OLEObject from the Excel file into the Powerpoint slide.
What I have done so far for the no. 2 is
Dim s As Shapes
For Each Obj in Worksheets("TEMPLATE").OLEObjects
'Copy OLEObjects from Excel to Powerpoint slide
Set s = pptSlide.Shapes.AddOLEObject '( ... ?? ... )
Next Obj
Please help me on how to copy the OLEObjects from the Excel file into the Powerpoint slide.
Thanks .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不简单地复制并粘贴 OBJObjects?
编辑评论
粘贴方法应该返回一个 ShapeRange 对象。您可以设置顶部和左侧返回的 ShapeRange 中第一个形状的属性。我没有测试这个(而且我不使用 VB.NET),但它应该是这样的:
Why not simply copy and paste the OBJObjects?
EDIT FOR COMMENT
The paste method should return a ShapeRange object. You can set the top and left properties of the first shape in your returned ShapeRange. I didn't test this (and I don't use VB.NET) but it should be something like this: