Visual Basic for Applications/Make a WAV File from a VBA String

Summary

 * This code module will make a voiced wav file starting from a VBA string. A reference should be set in the VBA editor to Microsoft Speech Object Library.
 * The parameters are just the intended string to be spoken and a full path to the intended file name.  The process MAKES a file but does not speak it as audio.   Once made, the wav file can be spoken with procedures in an adjacent page, or tested in Windows Explorer by simply opening it.
 * No error code has been added.  For example, if an attempt is made to use a folder with restrictions, an error will be raised.  Users might consider adding some error trapping.
 * The intended target wave file need not exist.  If it does not exist it will be made.   If it exists however, it will be overwritten.
 * Notice that the user should enter his own profile in the file path.  This author could not make the environmental paths work which would otherwise have made the code independent of the profile details.

VBA Code
Copy the entire code listing into an Excel standard module. Modify the paths to your own, and run the top procedure to make a reusable     wav file of the string. Remember to set a reference to Microsoft Speech Object Library.