Excel Text-to-Speech

msgb1080

New Member
Joined
Apr 27, 2011
Messages
8
I am fairly new to VBA, and I have a project for a class I am working on.

Our professor wants us to use the text-to speech function in Excel to have the computer read the instructions for our User Forms. The code I am using now is:

Private Sub cmdListen_Click()
Application.Speech.Speak (”Hello”)
End Sub

This is not working. Any suggestions?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Just tried that. I'm still getting Compile error: Variable not defined

When I deleted Option Explicit I didn't get the error anymore, but no sound comes out when I click on the command button.
 
Upvote 0
to be honest I have never used cmdlisten.click and dont know what it does, I just tried it using F5 in the module.

If you have a command button then maybe you should be using commandbutton.click
 
Upvote 0
My command button is named cmdListen, so cmdListen.click is just the button's click event.

Thanks for the help though!!
 
Upvote 0
OK, when I first used your code without the brackets it did not work as your appostrophies were somehow wrong, when I deleted them and used mine from shift+2 it worked, did you copy my code or rewrite it?
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,874
Members
452,949
Latest member
Dupuhini

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