Robonglious Posted June 20, 2012 Share Posted June 20, 2012 Hello again, I'm having some issues with WinWait. What I want to do is make some kind of benchmark where I can time how long programs take to open. It works great with Word(2010) but not with Excel(2010). I've tried this little bit of code to look up the handle using the PID but that doesn't seem to work and I'm wondering if anyone can help me understand how to look this up. Thank you, I'm feeling like I've got a long ways to go but I'm psyched. I'm slightly embarrassed about this bit of code... Local $begin = TimerInit() Run("C:\Program Files (x86)\Microsoft Office\Office14\winword.exe") WinWait("Document1 [Compatibility Mode] - Microsoft Word") $WordCount = Round ( (TimerDiff($begin)/1000) , 2 ) Run("C:\Program Files (x86)\Microsoft Office\Office14\Powerpnt.exe") WinWait("Presentation1 [Compatibility Mode} - Microsoft PowerPoint") $PowerCount = Round ( (TimerDiff($begin)/1000) , 2 ) MsgBox(64,"IS Department Benchmark for Word","Please see the opening time of word." & @CR & $WordCount &"Seconds" & $PowerCount & " seconds") Link to comment Share on other sites More sharing options...
Spiff59 Posted June 20, 2012 Share Posted June 20, 2012 (edited) Not sure if this works more like you wish or not... Local $begin = TimerInit() $oWord = ObjCreate("Word.Application") ProcessWait("winword.exe") $WordCount = Round ( (TimerDiff($begin)/1000) , 2 ) $oWord.quit $begin = TimerInit() $oExcel = ObjCreate("Excel.Application") ProcessWait("Excel.exe") $ExcelCount = Round ( (TimerDiff($begin)/1000) , 2 ) $oExcel.quit $begin = TimerInit() $oPP = ObjCreate("Powerpoint.Application") ProcessWait("Powerpnt.exe") $PPCount = Round ( (TimerDiff($begin)/1000) , 2 ) $oPP.quit MsgBox(64,"IS Department Benchmarks","Word: " & $WordCount & " seconds" & @CRLF & _ "Excel: " & $ExcelCount & " seconds" & @CRLF & _ "Powerpoint: " & $PPCount & " seconds") Edit: This would only time how long it takes to load and start the program (process), not how long it takes to fully initialize the program, process any parameters, and display a finished window. Maybe there is something in there you'll find inspiring. Edited June 21, 2012 by Spiff59 Link to comment Share on other sites More sharing options...
Robonglious Posted June 20, 2012 Author Share Posted June 20, 2012 Yes that is very inspiring, but I'm confused. How did you know that "Word.Application" is correct? Is there a list of these objects somewhere? This works much better thank you. Link to comment Share on other sites More sharing options...
Spiff59 Posted June 21, 2012 Share Posted June 21, 2012 The MSDN website has all those goodies, under Office Development.That particular list probably exists in half-a-dozen places on the site, but this is the first example that I found:http://msdn.microsoft.com/en-us/library/aa188526(v=office.10).aspx Link to comment Share on other sites More sharing options...
Robonglious Posted June 21, 2012 Author Share Posted June 21, 2012 Killer... thanks Spiff. I have so much to learn! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now