Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello:
Does anybody know if there is any issues or problems with function "PlayWavFile" in 2007? I tried using this but it keeps telling me function not defined. Please help. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Art,
Sounds like the declaration was lost: Declare Function PlayWavFile Lib "winmm.dll" Alias _ "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub PlayMySound() Call PlayWavFile("C:\WINDOWS\MEDIA\Jungle Error.WAV", 0) End Sub -- HTH, Bernie MS Excel MVP "art" wrote in message ... Hello: Does anybody know if there is any issues or problems with function "PlayWavFile" in 2007? I tried using this but it keeps telling me function not defined. Please help. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this in the worksheet:
Option Explicit Public Declare Function sndPlaySound Lib "winmm.dll" _ Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub PlayWavFile(WavFileName As String) sndPlaySound WavFileName, 1 End Sub and in the sheet module I have Sub TestPlayWavFile() PlayWavFile "C:\WINDOWS\Media\Windows XP Startup.Wav" End Sub Am I missing something? Please let me know. "Bernie Deitrick" wrote: Art, Sounds like the declaration was lost: Declare Function PlayWavFile Lib "winmm.dll" Alias _ "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub PlayMySound() Call PlayWavFile("C:\WINDOWS\MEDIA\Jungle Error.WAV", 0) End Sub -- HTH, Bernie MS Excel MVP "art" wrote in message ... Hello: Does anybody know if there is any issues or problems with function "PlayWavFile" in 2007? I tried using this but it keeps telling me function not defined. Please help. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Art,
Put it all into a regular codemodule, not in the sheet's codemodule.. HTH, Bernie MS Excel MVP "art" wrote in message ... I have this in the worksheet: Option Explicit Public Declare Function sndPlaySound Lib "winmm.dll" _ Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub PlayWavFile(WavFileName As String) sndPlaySound WavFileName, 1 End Sub and in the sheet module I have Sub TestPlayWavFile() PlayWavFile "C:\WINDOWS\Media\Windows XP Startup.Wav" End Sub Am I missing something? Please let me know. "Bernie Deitrick" wrote: Art, Sounds like the declaration was lost: Declare Function PlayWavFile Lib "winmm.dll" Alias _ "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub PlayMySound() Call PlayWavFile("C:\WINDOWS\MEDIA\Jungle Error.WAV", 0) End Sub -- HTH, Bernie MS Excel MVP "art" wrote in message ... Hello: Does anybody know if there is any issues or problems with function "PlayWavFile" in 2007? I tried using this but it keeps telling me function not defined. Please help. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can you please give me the whole code in one length since I'm not so famiar
with it. I tried but there is something wrong I'm doing. So please give me the whole code I should use. Thanks. "Bernie Deitrick" wrote: Art, Put it all into a regular codemodule, not in the sheet's codemodule.. HTH, Bernie MS Excel MVP "art" wrote in message ... I have this in the worksheet: Option Explicit Public Declare Function sndPlaySound Lib "winmm.dll" _ Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub PlayWavFile(WavFileName As String) sndPlaySound WavFileName, 1 End Sub and in the sheet module I have Sub TestPlayWavFile() PlayWavFile "C:\WINDOWS\Media\Windows XP Startup.Wav" End Sub Am I missing something? Please let me know. "Bernie Deitrick" wrote: Art, Sounds like the declaration was lost: Declare Function PlayWavFile Lib "winmm.dll" Alias _ "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub PlayMySound() Call PlayWavFile("C:\WINDOWS\MEDIA\Jungle Error.WAV", 0) End Sub -- HTH, Bernie MS Excel MVP "art" wrote in message ... Hello: Does anybody know if there is any issues or problems with function "PlayWavFile" in 2007? I tried using this but it keeps telling me function not defined. Please help. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In a regular codemodule:
Option Explicit Public Declare Function sndPlaySound Lib "winmm.dll" _ Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub PlayWavFile(WavFileName As String) sndPlaySound WavFileName, 1 End Sub 'This is the sub to run: Sub TestPlayWavFile() PlayWavFile "C:\WINDOWS\Media\Windows XP Startup.Wav" End Sub HTH, Bernie MS Excel MVP "art" wrote in message ... Can you please give me the whole code in one length since I'm not so famiar with it. I tried but there is something wrong I'm doing. So please give me the whole code I should use. Thanks. "Bernie Deitrick" wrote: Art, Put it all into a regular codemodule, not in the sheet's codemodule.. HTH, Bernie MS Excel MVP "art" wrote in message ... I have this in the worksheet: Option Explicit Public Declare Function sndPlaySound Lib "winmm.dll" _ Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub PlayWavFile(WavFileName As String) sndPlaySound WavFileName, 1 End Sub and in the sheet module I have Sub TestPlayWavFile() PlayWavFile "C:\WINDOWS\Media\Windows XP Startup.Wav" End Sub Am I missing something? Please let me know. "Bernie Deitrick" wrote: Art, Sounds like the declaration was lost: Declare Function PlayWavFile Lib "winmm.dll" Alias _ "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub PlayMySound() Call PlayWavFile("C:\WINDOWS\MEDIA\Jungle Error.WAV", 0) End Sub -- HTH, Bernie MS Excel MVP "art" wrote in message ... Hello: Does anybody know if there is any issues or problems with function "PlayWavFile" in 2007? I tried using this but it keeps telling me function not defined. Please help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|