View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default Speech.Speak error

I'm working on a Jeopardy game that uses the Speech.Speak method to read the
questions and answers and a double-click event to move through worksheets
containing them. I've found that double-clicking too soon after the Speak
command causes the macro to crash on the next line of code.

Here's a simple example. I've found that with the following module if I
double-click too soon a second time, the macro crashes. I tried inserting a
pause loop before the speech command, but that doesn't make a difference. I
think I understand why that doesn't work, something to do with keystroke
buffers, if that's the right term.

Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target
As Range, Cancel As Boolean)

Dim pause As Double

Cancel = True
Application.Speech.Speak Application.UserName & "is an excellent programmer"

End Sub

Any suggestions on how to fix?

Thanks,

Doug