Speak Delay in VBA macro

myemail1248

New Member
Joined
Jan 17, 2017
Messages
15
Greetings. I have an excel sheet that has 2 drop down items that are linked together. When choosing a value in 1 drop down the other drop down value updates accordingly. What I have done is attach the Speech application macro to each of the drop downs (same macro for each) that speaks the values of each drop down box when clicked. It works fine...except, there is always a delay in updating the value of the second (non-clicked) drop down until after it has finished speaking.
Is there a way to have the drop downs update before the speech?
excel 2013
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
A bit of a shot in the dark, but perhaps you could move the SPEAK portion of your code to a Worksheet_Calculate event macro referring to the two drop downs cells.

With the thought being the first drop down selection makes the second drop down respond to a formula (hence a calculation) and the Calculate will then SPEAK the two referenced cells values.

Howard
 
Upvote 0
.
Interesting. Can you post your code here for review ?
 
Upvote 0
.
Interesting. Can you post your code here for review ?

Here is what I have so far:
Application.Speech.Speak ThisWorkbook.Sheets("DATA4").Range("F2").Cells & ThisWorkbook.Sheets("DATA4").Range("H2").Cells & "inches"

The operator selects a drill by it's name (F2) or by it's decimal size (H2) from drop downs. When the drop downs are executed, the Speech application states the value of these 2 cells and then adds the word inches after reading the value of H2.

I still have not started working on Howard's approach. Still researching. But, it sounds promising.
 
Upvote 0
I believe L.Howard's suggestion is on topic.

A different approach would be adding this line of code immediately prior to the "Application.Speak.Speech" line :

Code:
Application.Wait (Now + TimeValue("0:00:01"))   '<-- :01 = one second. Change to :05 for five seconds
 
Upvote 0
I believe L.Howard's suggestion is on topic.

A different approach would be adding this line of code immediately prior to the "Application.Speak.Speech" line :

Code:
Application.Wait (Now + TimeValue("0:00:01"))   '<-- :01 = one second. Change to :05 for five seconds

You are correct Logit. It works! Thank you so much for the help you guys.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top