Speech.Speak error

  • Thread starter Thread starter Doug Glancy
  • Start date Start date
D

Doug Glancy

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
 
Doug,

Try

Application.Speech.Speak _
Application.UserName & "is an excellent programmer", True



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top