自动IT COM打开PPT/PPTX时出错

自动IT COM打开PPT/PPTX时出错,com,powerpoint,autoit,Com,Powerpoint,Autoit,当我尝试打开PPT的顶部,而不是创建一个新的(这很好!),我得到以下错误 $objPPT = _PPT_PowerPointApp() If @error Then MsgBox(0,"","No PowerPoint available") Exit EndIf $PresInterface = _PPT_CreatePresentation($objPPT) ;Get presentation interface$objPres = _PPT_PresentationO

当我尝试打开PPT的顶部,而不是创建一个新的(这很好!),我得到以下错误

$objPPT = _PPT_PowerPointApp()
If @error Then 
    MsgBox(0,"","No PowerPoint available") 
    Exit
EndIf
$PresInterface = _PPT_CreatePresentation($objPPT) ;Get presentation 
interface$objPres = _PPT_PresentationOpen($PresInterface,"C:\Users\s.mailappan\Desktop\3G-Reports\MyAutoItPresentation.ppt") ;Add a new presentation

要打开现有PPT,需要从我的原始代码中删除以下行

$PresInterface = _PPT_CreatePresentation($objPPT) ;Get presentation 
这使得下面的代码能够正常工作

$objPPT = _PPT_PowerPointApp()
If @error Then 
    MsgBox(0,"","No PowerPoint available") 
    Exit
EndIf

$objPres = _PPT_PresentationOpen($objPPT,"C:\Users\s.mailappan\Desktop\3G-Reports\MyAutoItPresentation.ppt") ;Add a new presentation

最后两行可能弄乱了?变量
$objPres
前面不应该直接有“接口”…是的…我成功了!无论如何谢谢你!!