Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am working on a science fair project and am trying to build a progra using Excel 97 to measure reaction time. The program opens powerpoint file and begins showing slides. When certain slide come-up, a timer starts to measure how long it takes a person t recognize the slide and either click the mouse or hit a key. I'v gotten everything to work except how to use the mouse click or key t stop the timer. I think Click event is what I need but I do not kno how to use it. The following is what I have so far. Any help would b greatly appreciated. Sub RunPowerPoint() Dim filepath As String Dim NumSlides, Slides As Integer filepath = Worksheets("PowerPointFiles").Range("B1").Value NumSlides = Worksheets("PowerPointFiles").Range("B2").Value Slides = 0 'Initialize 'Shell to open PowerPoint returnvalue = Shell("C:\Program Files\Microsof Office\Office\POWERPNT.EXE", 1) 'Open File on desk top SendKeys "%o", True SendKeys "{enter}", True SendKeys filepath, True SendKeys "{enter}", True 'Open Slide Show SendKeys "%f", True SendKeys "{right 2}", True SendKeys "{down 4}", True SendKeys "{enter}", True 'Show Slides Do If Slides = NumSlides Then Exit Do PauseTime = 6 ' Set duration. Start = Timer ' Set start time. Do While Timer < Start + PauseTime DoEvents ' Yield to other processes. Loop SendKeys "{right}", True Slides = Slides + 1 Loop 'Close Power Point AppActive = returnvalue SendKeys "{esc}", True SendKeys "%f", True SendKeys "x", True End Su -- dn ----------------------------------------------------------------------- dnj's Profile: http://www.excelforum.com/member.php...fo&userid=1636 View this thread: http://www.excelforum.com/showthread.php?threadid=27751 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Click event to run only once | Excel Programming | |||
Click event to run only once | Excel Programming | |||
Click event to run only once | Excel Programming | |||
Click event to run only once | Excel Programming | |||
Click Event | Excel Programming |