R
RAHUL
Hi All,
I am doing office automation in my C++ application using the folloing
code. Most of the time the code runs fine, but on some windows XP
machines with PowerPoint 2003 (11.8307.8221 SP3) installed the source
line marked with "ERROR" throws exception saying "Invalid request.
There is no active presentation.". If I reexecute the code on this
machine then it runs successfully (The error comes for the first time
only)
i.e. If POWERPNT.exe is already running in background then the error
never comes, But the error always come on that machine when the code
is run first time.
Is this happening due to some corrupt installation or registry value?
Is there a way to get more information as "why is the error
happening"?
Any help is greatly appreciated.
CApplication powerPointApp;
COleException exception;
if (!powerPointApp.CreateDispatch(L"Powerpoint.Application",
&exception))
{
CPresentations presSet(powerPointApp.get_Presentations());
CPresentation thempPPT(presSet.Open(strTempFileName, // Filename
true, // Readonly
false, // Untitled
false // WithWindow
));
VARIANT vtIndexSrc;
vtIndexSrc.vt = VT_I4;
vtIndexSrc.lVal = 1; // The PPT file always have 1 slide
CSlides tempPPTSlides(thempPPT.get_Slides());
CSlide singleSlide(tempPPTSlides.Item(vtIndexSrc)); // "ERROR"
}
Thanks in advance
Rahul
I am doing office automation in my C++ application using the folloing
code. Most of the time the code runs fine, but on some windows XP
machines with PowerPoint 2003 (11.8307.8221 SP3) installed the source
line marked with "ERROR" throws exception saying "Invalid request.
There is no active presentation.". If I reexecute the code on this
machine then it runs successfully (The error comes for the first time
only)
i.e. If POWERPNT.exe is already running in background then the error
never comes, But the error always come on that machine when the code
is run first time.
Is this happening due to some corrupt installation or registry value?
Is there a way to get more information as "why is the error
happening"?
Any help is greatly appreciated.
CApplication powerPointApp;
COleException exception;
if (!powerPointApp.CreateDispatch(L"Powerpoint.Application",
&exception))
{
CPresentations presSet(powerPointApp.get_Presentations());
CPresentation thempPPT(presSet.Open(strTempFileName, // Filename
true, // Readonly
false, // Untitled
false // WithWindow
));
VARIANT vtIndexSrc;
vtIndexSrc.vt = VT_I4;
vtIndexSrc.lVal = 1; // The PPT file always have 1 slide
CSlides tempPPTSlides(thempPPT.get_Slides());
CSlide singleSlide(tempPPTSlides.Item(vtIndexSrc)); // "ERROR"
}
Thanks in advance
Rahul