Here is a version of your setup that works the way you have defined.
Note that I have made some extensive changes to simplify your code without changing the basic structure. A few tips:
When you record a macro, Excel records every individual step, such as selecting a cell with the cursor. But in reality, you do not have to select a cell to be able to refer to the data in it. For example:
Also, if you leave out the Selects, your user doesn't see any screen activity, and things are sped up considerably.
Also, the code for nearly all your button presses is exactly the same, except for the address of the cell that contains the hyperlink and the address of the cell that contains the text that will be spoken. I have created a single Sub with two parameters for those two things. Then your button handlers simply call this Sub. Next time you need to make a change, you can make it in one place instead of 35 places.
I also renamed your modules to reflect their purpose, and moved all the button handlers into the same module.
I added a worksheet called Log that will log everything that happens. It is primarily to show you what the code is doing, but you may want to keep it around anyway. If not you can just delete the sheet, and remove the lines of code that start Log.LogEntry (they will cause errors if the worksheet Log doesn't exist).
In PlayWavFile, I suggest you use a different name other than Wait for your parameter, which is the same name as the procedure Application.Wait. It works fine but can be confusing.
Similar issue with your Sub called Time.
Phew! If this works you owe me a Foster's, mate!
Bookmarks