Y
yo beee
Hello all,
I am using the following code to play a wave file and it works
perfectly.
Sub PlayMe3()
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Dim retval As Long
retval = PlaySound("C:\ABCDirectory\ACDB\wavtest.wav", _
0, SND_ASYNC Or SND_FILENAME)
End Sub
However, if the directory name is changed it will not work without changing
the name in the macro as well. Can anyone suggest a change in the macro to
play the wave file in the directory what ever the name of the directory is?
The wave file is normally saved in the same directory as the excel file. So
basically the macro needs to call up the wave file in what ever the
directory is that the excel file resides in. I was thinking something like:
Sub PlayMe3()
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Dim retval As Long
retval = PlaySound("..\..\wavtest.wav", _
0, SND_ASYNC Or SND_FILENAME)
End Sub
....this did not work, by the way. Any help is appreciated.
TIA,
yo beee
I am using the following code to play a wave file and it works
perfectly.
Sub PlayMe3()
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Dim retval As Long
retval = PlaySound("C:\ABCDirectory\ACDB\wavtest.wav", _
0, SND_ASYNC Or SND_FILENAME)
End Sub
However, if the directory name is changed it will not work without changing
the name in the macro as well. Can anyone suggest a change in the macro to
play the wave file in the directory what ever the name of the directory is?
The wave file is normally saved in the same directory as the excel file. So
basically the macro needs to call up the wave file in what ever the
directory is that the excel file resides in. I was thinking something like:
Sub PlayMe3()
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Dim retval As Long
retval = PlaySound("..\..\wavtest.wav", _
0, SND_ASYNC Or SND_FILENAME)
End Sub
....this did not work, by the way. Any help is appreciated.
TIA,
yo beee