excel - 从 powerpoint 复制内容
问题描述
我可以从 powerpoint 复制内容,但在将其粘贴到另一个 powerpoint 时出现错误。
错误在这一行
pres2.Slides.Paste Index:=pres2.Slides.Count + 1
Dim OutApp As Object
Dim fileNameString As String
Dim NewSlide As Slide
Dim i As Integer
Dim Nstring As String
Dim Nstring1 As String
Dim Allshape As Object
Dim pres1 As PowerPoint.Presentation, pres2 As PowerPoint.Presentation, pp As Object
On Error Resume Next
Set pp = GetObject(, "PowerPoint.Application")
If Err.Number <> 0 Then Set pp = CreateObject("PowerPoint.Application")
On Error GoTo 0
Set pres1 = pp.Presentations.Open(Sheet1.TextBox1.Text)
Set pres2 = pp.Presentations.Open(Sheet1.TextBox2.Text)
Set NewSlide = pres1.Slides(2)
Set Allshape = NewSlide.Shapes
Allshape.Range.Copy
pres2.Slides.Paste Index:=pres2.Slides.Count + 1
解决方案
推荐阅读
- twitter - 我需要创建一个新的 Twitter 帐户来创建机器人吗?
- pine-script - PineScript - 如何获取历史每日收盘价
- django - 如何访问 djongo 模型上的 _id 字段,它返回无
- javascript - 重定向到 PHP 中的另一个页面
- python - 我可以在 py spark 中读取本地文件,但无法在本地文件中写入数据帧
- algorithm - 通过邻域中的样本计算 3D 点的法线
- ruby-on-rails - Ruby on Rails - 按 created_at 和 sort_by 按布尔排序记录
- kotlin - Android Appium 摄像头测试:如何像来自摄像头一样注入视频以使用 Appium 测试应用程序
- php - 使用exif压缩后如何在上传时更改图像方向 - PHP
- python - 使用 python openpyxl 检查重复值和输入值