使用Excel打开新的PowerPoint演示文稿失败

时间:2020-06-15 19:24:42

标签: excel vba powerpoint

我正在尝试从excel创建一个PowerPoint演示文稿,其中我使用excel中的行来创建幻灯片,因此我被困在打开演示文稿中。我收到一个错误“对象'Presentations'的'方法'打开'失败。有关此问题,阅读了许多其他文章,但缺少一些可能很愚蠢和明显的内容。

这是代码

Sub LoadPPTDescriptions()

'   Purpose: Rowlevel copy between worksheets
'   Support: 
'   

'   Define global variables
Dim CurrWorkbook As Workbook
Dim RowValueStream As String
Dim RowInitiative As String
Dim RowPriority As Integer
Dim CurrWorksheet As Worksheet
Dim TargetWorksheet As Worksheet
Dim CurrWorksheetName As String
Dim CurrRange As Range
Dim RangeStr As String
Dim RowStr As String
Dim i As Integer
Dim j As Integer
Dim PPTSlideNum As Integer
Dim PPTObect As PowerPoint.Application
Dim PPTShape As PowerPoint.Shape
Dim PPTPres As PowerPoint.Presentation
Dim PPTFile As String
Dim PPTTableRow As Integer





'   Set Current Workbook and set target worksheet
Set CurrWorkbook = ThisWorkbook

'   Initialize counter to point to first row in target worksheet
TargetRow = 5

'   Initialize Powerpoint Object
Set PPTObject = New PowerPoint.Application
PPTObject.Visible = True


'   Create Powerpoint Deck
PPTFile = "C:\TEST99.ppt"
Debug.Print "FILENAME>" + PPTFile + "<FILENAME"
Set PPTPres = PPTObject.Presentations.Open(PPTFile) 'GET ERROR HERE - Method open of object presentations failed 

End Sub

0 个答案:

没有答案
相关问题