0
ExcelからPowerPointファイルを開くのが好きです。 私は数回試しましたが、うまくいきません。VBAを使用してPowerPointファイルを開くことができません
問題は、これらに類似の音:
'Laufzeitfehler '-2147024894(80070002)': ダイMethodeの' オープン
が唯一の違いはあるnot able to Open Powerpoint using VBA
が、私は別のエラーコードを取得します'fürdas Objekt'プレゼンテーション 'ist fehlgeschlagen。
Microsoft PowerPoint 16.0オブジェクトライブラリが有効であることを確認しました。そして私はファイルパスを何度か調べました。
誰かが間違いが何であるか考えている人はいますか?
Sub sub_powerpoint_test()
Dim ObjPPT As PowerPoint.Application
Dim ObjPresentation As PowerPoint.Presentation
Dim str_FileName_PPTX As String
Set ObjPPT = CreateObject("PowerPoint.Application")
ObjPPT.Visible = msoCTrue
'Get PPT Filename
If Len(Dir(ThisWorkbook.Path & "\*.pptx")) = 0 Then
MsgBox "PPTX file does NOT exist in this folder."
Else
str_FileName_PPTX = ThisWorkbook.Path & Dir(ThisWorkbook.Path & "\*.pptx")
Debug.Print str_FileName_PPTX
End If
Set ObjPresentation = ObjPPT.Presentations.Open(str_FileName_PPTX, Untitled:=msoTrue)
End Sub
最後に[開く]行にエラーが発生します。