Help Using Click Event

D

dnj

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
 

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