Private oPpt As PowerPoint.Application
Private ppt As PowerPoint.PresentationSet oPpt = CreateObject("PowerPoint.Application")Set ppt = oPpt.Presentations.Open("c:\a.ppt")怎么运行到最后一句Set ppt = oPpt.Presentations.Open("c:\a.ppt")抱错啊
错误代码:
Run_time error '-2147188160(80048240)'
Presentation(unknown member):Invalid request.The PowerPoint 
Frame window does not exist.我用类似的方法打开word,excel没有问题,请问该如何打开ppt文档呢?

解决方案 »

  1.   

    ' Open PowerPoint
        Dim strPowerPointFile As String
        Dim pptobj As PowerPoint.Application
        Set pptobj = New PowerPoint.Application
        pptobj.Visible = True
        
        strPowerPointFile = "c:\a.ppt"
        
        pptobj.Presentations.Open(strPowerPointFile)
        
      

  2.   

    or:
        '......
        Set pptobj = New PowerPoint.Application
        pptobj.Visible = True    Set pptobj = New PowerPoint.Application
        pptobj.Visible = True    Dim ppt As PowerPoint.Presentation
        Set ppt = oPpt.Presentations.Open("c:\a.ppt")
    ' Close PowerPoint
        pptobj.Quit
        Set pptobj = Nothing
      

  3.   

    Set oPpt = CreateObject("PowerPoint.Application")oPPT.Visible = msoTrue
      

  4.   

    PPT很特別,必須得顯示運行,而其他的可以隱藏。