Error Handling for speech module?

SURFER349

Board Regular
Joined
Feb 22, 2017
Messages
50
So I've got this code to talk to the user while the macro runs, to prevent them from clicking all over the place and crashing the program.


Code:
Sub UseSpeech() 'speech while macro runs. 
Application.Speech.Speak "Hello  " & Application.UserName & ".  Please wait about 10 seconds while the macro runs in the background.", SpeakAsync:=True
End Sub

So it works great on most computers, but some people are getting this error.

Run-time error '-214720096 (8004503a)
Method 'Speak' of object 'Speech' failed

I don't want to ask all these old people to update their dll's and objects. Can someone help me with syntax for an error handling that will skip if there's an error here?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
If I were a user, I'd prefer that you put up a modal userform, perhaps with a progress bar, until the macro completes. I don't like my computer speaking unless spoken to.
 
Upvote 0
If I were a user, I'd prefer that you put up a modal userform, perhaps with a progress bar, until the macro completes. I don't like my computer speaking unless spoken to.

Good idea. Tips or link on how to make this happen? or some sort of big gif that is splashed across the screen?
 
Upvote 0
Did you look at the code in the workbook?
 
Upvote 0
yes, it says 'insert code here' but then keeps popping up w/ the tabbed example box.

I don't know what that means.

Did you try exporting the userform of interest to a folder and then importing it?

Or you could open the workbook in your version of Excel, save it as an xlsm file, and them move your data into it.

You're a little stingy with details.
 
Last edited:
Upvote 0
so i'm not sure if you're looking at something different. The file from your link "progressmeters.xls" has a single button on it, which pops up a user form to demonstrate various progress bars.

when inspecting the script for these, you see they are on "userform1" and its a list of many different subs. Each says "Your code would go here".

So inserting my code, or even just a short thing to do a few cell manipulations, then F5, just brings up the userform popup again, with all the tabs and examples.

Exporting the form and importing it to my original workbook does the same thing. It pops up the userform demonstrating examples of the different progress bars.

On top of that, it appears to be re-running my code each time the progress bar increments. So its re-running a big macro a hundred times to get from 0-->100 progress.
 
Upvote 0
The basic notion of a progress meter is that you need either need to have

o a loop that iterates until done, in which case you increment a variable from 0 to 1 (0% to 100%), and pass that variable to the code in a form that displays in in some fashion, or

o code that does several things, and you decide (maybe pretty arbitrarily) what fraction is complete in each step, and you pass that variable (0 to 1) to the form code.

The point in either case is just to show the user that things are happening, the computer isn't frozen, calm down and wait.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,322
Members
452,635
Latest member
laura12345

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