LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
dnj dnj is offline
external usenet poster
 
Posts: 1
Default Help Using Click Event


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Click event to run only once gavmer[_93_] Excel Programming 0 October 12th 04 12:34 AM
Click event to run only once gavmer[_92_] Excel Programming 1 October 8th 04 07:23 AM
Click event to run only once gavmer[_91_] Excel Programming 0 October 7th 04 12:07 AM
Click event to run only once gavmer[_82_] Excel Programming 1 September 30th 04 12:42 PM
Click Event Nichevo Excel Programming 2 December 4th 03 04:31 AM


All times are GMT +1. The time now is 08:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"