GetObject and PPT

  • Thread starter Thread starter Casey Brown
  • Start date Start date
C

Casey Brown

Hi,

I am having a problem with a VB6 app that uses PPT 2000 to create
presentations, and I thought some of you here might have some insights into
PPT intrinsics that might be contributing to my problem. Sorry this is a
long explanation...

Basically, my app takes info from a web service, opens ppt and creates a
presentation with the info, then closes ppt and calls it a day. It works
fine almost all of the time. Sometimes, however, it doesn't get past the
call below to GetObject. The last line in my debugging file is "About to
call GetObject"--the error handling code is never reached. GetObject
appears just to hang and never either succeeds or fails! (DebugPrint just
prints to a text file)

A problem for me is that this is running on a client's machine, so I don't
have much data other than the aborted debug log. I know that it ran for
about a week before GetObject failed (though I don't know how many times per
day--probably on the order of 10-20, not thousands). After GetObject fails
once, it continues to fail until Powerpoint is reinstalled, at which point
it seems to work again.

Anyone have any idea what might be going on? I know it's vague, but I
thought maybe someone might have run into something similar. What sort of
things might PPT be doing that would be preventing GetObject from returning?
Might autosave files affect things? Waiting for some type of user input?
Waiting for the Red Sox or Cubs to win the World Series?

Thanks for any thoughts you might have!

-Casey

'my code snippets are below:

Private Function OpenPPT(path As String) As Boolean
On Error GoTo OpenPPTError
....
wasRunning = True
DebugPrint "About to call GetObject"
Set pptApp_ = GetObject(, PPTAPPNAME)
DebugPrint "Just called GetObject. WasRunning is " & wasRunning
....
OpenPPTError:
DebugPrint "Error! Number: " & Err.Number & ", Description: " &
Err.Description
If Err.Number = 429 Then
'determined that ppt was not already open
wasRunning = False
Err.Clear
Else
....
 
I actually do use CreateObject if GetObject fails. It's just an extra
measure to ensure that i don't have multiple copies of whatever application
i'm creating (in this case, powerpoint).

-Casey
 
You won't have multiple copies of PowerPoint. It's a single instance
application.
 
Shyam,

You're right about that--I know it is a single instance application.
GetObject isn't needed for powerpoint, but it is for other applications,
which is why it is included.

Regardless of powerpoint's single instance status, do you have any idea why
GetObject might be behaving as it is? The call should raise an error, not
hang, regardless of whether or not powerpoint is a single instance app.

Thanks!

-Casey
 
Back
Top