RAHUL
2009-12-09 04:49:43 UTC
Hi All,
While doing PowerPoint automation in my VC++ code the function
"InsertFromFile" fails and a "Run-time error '0'" dialog comes. Could
somebody please tell what might be causing this error. Since there is
no error code (its 0) I do not know how to proceed.
Since an error dialog is shown by PowerPoint saying "Run-time error
'0'" all of the automation statements after the call "InsertFromFile"
fails because PowerPoint do not responds and the functions (e.g. Save
()) times out and throws exception.
Is there any way to dismiss the dialog "Run-time error '0'"
automatically so that the latter statements succeeds.
The same "Run-time error '0'" comes when I try to do the same thing in
VBA script (as mentioned in the code below). But surprisingly the
error does not come it I open the presentation with a window and make
PwoerPoint visible.
Thanks
Rahul
VBA equivalant of my VC++ source code (This also causes error)
Sub Macro1()
Set App = CreateObject("PowerPoint.Application")
Set presSet = App.Presentations
Set finalPres = presSet.Open("C:\Work\Bugs\test.ppt",
MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse)
Set dstSlides = finalPres.Slides
dstSlides.InsertFromFile "C:\Work\Bugs\test.1.ppt", 2
finalPres.Save
End Sub
While doing PowerPoint automation in my VC++ code the function
"InsertFromFile" fails and a "Run-time error '0'" dialog comes. Could
somebody please tell what might be causing this error. Since there is
no error code (its 0) I do not know how to proceed.
Since an error dialog is shown by PowerPoint saying "Run-time error
'0'" all of the automation statements after the call "InsertFromFile"
fails because PowerPoint do not responds and the functions (e.g. Save
()) times out and throws exception.
Is there any way to dismiss the dialog "Run-time error '0'"
automatically so that the latter statements succeeds.
The same "Run-time error '0'" comes when I try to do the same thing in
VBA script (as mentioned in the code below). But surprisingly the
error does not come it I open the presentation with a window and make
PwoerPoint visible.
Thanks
Rahul
VBA equivalant of my VC++ source code (This also causes error)
Sub Macro1()
Set App = CreateObject("PowerPoint.Application")
Set presSet = App.Presentations
Set finalPres = presSet.Open("C:\Work\Bugs\test.ppt",
MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse)
Set dstSlides = finalPres.Slides
dstSlides.InsertFromFile "C:\Work\Bugs\test.1.ppt", 2
finalPres.Save
End Sub