[snippasnippasnippasnip]
Can't say for certain, but it seems PPT must have a window to from
which to work - and scripting just doesn't provide one.
It does seem odd. You can automate it hidden from other apps or VB, and as long as you
open the presentation windowless (what the final False parameter I mentioned earlier
specifies) and don't try to do anything that explicitly refers to the window, you should
be ok.
set oPresentation = oPP.Presentations.Open(sPath & sMasterName,,False)
<wild_speculation>
Could there be something about the way VBS passes parms to other apps?
Might ALL parms have to be explictly specified, as in:
set oPresentation = oPP.Presentations.Open(sPath & sMasterName,False,False)
</wild_speculation>
That doesn't help. It appears Powerpoint MUST have a window. It
still errors out on that line, failing to open the file.
One other possibility is to launch the app minimized if VBS permits that. There's a
window then, but it's not visible (other than on the taskbar and no fair peeking). No
visible window, nothing to refresh so it should run more quickly.
{snip}
As far as I can tell, that doesn't have any impact. HOWEVER, after
restructuring the script to workaround a bug I encountered running the
script under Win2K (but not in XP - both running 2003SP2, though the
XP one is a commercial package and the 2K a student version - I
haven't compared the build numbers) the script ran lightning fast ---
at first. BUT, the longer it ran (looping through multiple input
files, creating a set of slides for each into separate ppt
presentations), the slower it got. It started at 15 to 20 per minute,
but slowed to fewer than one a minute at about the 90th file. It had
nothing to do with the content of the file, for I aborted the loop and
retried stating at the 98th file in blocks of 10 and each group
completed in mere seconds (whether fullscreen or minimized). It is
truly mind boggling.
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:
www.pptfaq.com
PPTools:
www.pptools.com
================================================
My wild speculation is that PPT either has a massive memory leak
(though I can't detect it using the Task Manager) or else the OS keeps
relegating fewer and fewer CPU cycles the longer PPT is running. This
seems to be the more likely of my speculations, as the CPU usage was
unmeasurable during the earlier run when it bogged down at file number
98. When I retested in blocks of ten files, the usage would spike to
75-80 percent while the script was running.
So, I don't see any need to pursue the screen redraw issue any longer,
since it appears the major problem is related more to how the OS is
allocating time to its various processes.
Well - while composing this a thought came to me - maybe the script
looping was causing the system to get bound up with too many pending
processes. Sooooo - I added a half-second sleep after processing a
file in the loop to give pending threads access to the processor.
That did the trick. It is now handling more than 30 files a minute.
I can't ask for more than that.
Thanks for the help, but my overriding problem does not seem to be PPT
related.
Tom Lavedas
===========