Problem of Powerpoint automation in VB6.0

J

Jin

Dir Sir,
Recently I have developed a ' WelcomeBoard ' system
with VB6.0 .This system is mainly to display some
information on Plasma in the lobby of a building. It has
to automate Powerpoint2000 and instantly open and close
pps file and ppt file with macro with powerpoint object.
It is required to run 24hours a day.
This system could smoothly run usually. But it could
get into dead for about one time in every two weeks.

Followings are part of codes:
dim PPT as new powerpoint.application
set PPT=createobject("powerpoint.application")
...
PPT.Presentations.Open ppsfile ' Here open a
pps file
...
if PPT.Presentations.count>0 then
PPT.Presentations.item(1).close
end if
PPT.Presentations.Open ppsfile
...
if PPT.Presentations.count>0 then
PPT.Presentations.item(1).close
end if
...
It seems that this system is stoped at sentence 'if
PPT.Presentations.Count>0 then' or 'PPT.Presentations.item
(1).close'.
Maybe the PPT viable has lost the reference to
Powerpoint object. But I dont know the true cause.
Please help me!
Thank you! and Happy new year!
 
B

Brian Reilly, MS MVP

Jin,
If this is running for a while and closing and reopening the PPT file
successfully, then it is likely a memory leak. A solution that would
work for PPT 2000 but does not work in the PPT 2003 Viewer, but would
work in PPT (full program) would be to nest to PPT open and close
routines within a Do While loop. You wouldn't have to close PPT
everytime for you could increment a variable or work off the Now()
constant and close and restart PPT completely at some crazy hour of
the day when no one would care.

PPT seems to have a memory leak for some reason and this has been a
known problem for a while.

Brian Reilly, PowerPoint MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top