A
Andy Fish
Hi,
I have office 2003 powerpoint with SP1 and I find that running the following
code causes powerpoint to remain in memory
Dim app As PowerPoint.Application
Dim pres As PowerPoint.Presentation
Set app = New PowerPoint.Application
Set pres = app.Presentations.Open("c:\small.ppt", msoTrue, msoFalse,
msoFalse)
pres.Close
app.Quit
Set app = Nothing
If I don't open a presentation, the app.Quit seems to quit the application
properly.
If I can explain why this is such a big deal to me, maybe someone can help
with the solution:
I absolutely *must* run a powerpoint ole process on a server (even though
microsoft don't like it). Because I had problems doing that with with Word,
I implemented a mechanism which identified the process ID of the winword.exe
so that if the OLE operation got stuck (usually because word was trying to
put up a dialog box) I could just kill the process from another thread.
The only safe way to find out the process ID of the word ole server was to
list all processes having the executable name "winword.exe" before and after
creating the application object, then just take the difference.
Now, the problem with powerpoint is that sometimes creating the application
object will start up a new powerpnt.exe and sometimes it won't. so there is
no simple way to identify the actual process.
is this behaviour by design, a bug, or is it something specific to my
installation?
Andy
I have office 2003 powerpoint with SP1 and I find that running the following
code causes powerpoint to remain in memory
Dim app As PowerPoint.Application
Dim pres As PowerPoint.Presentation
Set app = New PowerPoint.Application
Set pres = app.Presentations.Open("c:\small.ppt", msoTrue, msoFalse,
msoFalse)
pres.Close
app.Quit
Set app = Nothing
If I don't open a presentation, the app.Quit seems to quit the application
properly.
If I can explain why this is such a big deal to me, maybe someone can help
with the solution:
I absolutely *must* run a powerpoint ole process on a server (even though
microsoft don't like it). Because I had problems doing that with with Word,
I implemented a mechanism which identified the process ID of the winword.exe
so that if the OLE operation got stuck (usually because word was trying to
put up a dialog box) I could just kill the process from another thread.
The only safe way to find out the process ID of the word ole server was to
list all processes having the executable name "winword.exe" before and after
creating the application object, then just take the difference.
Now, the problem with powerpoint is that sometimes creating the application
object will start up a new powerpnt.exe and sometimes it won't. so there is
no simple way to identify the actual process.
is this behaviour by design, a bug, or is it something specific to my
installation?
Andy