Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Can I use VBA to play a WAV file?

Hello all,

Can I use VBA to play a WAV file or some other sound file format? I do not want the playing of this sound to open up an external
media player and be played inside of it, I want it to be a sound that just plays (like Windows and other programs events sounds).

--
Thanks for any help anyone can provide,

Conan Kelly


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Can I use VBA to play a WAV file?

Hi Conan,

'------------------------
Can I use VBA to play a WAV file or some other sound file format?
I do not want the playing of this sound to open up an external
media player and be played inside of it, I want it to be a sound that just
plays (like Windows and other programs events sounds).

'------------------------

See John Walkenbach at:

http://www.j-walk.com/ss/excel/tips/tip87.htm


---
Regards,
Norman


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Can I use VBA to play a WAV file?

Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" _
(ByVal lpszName As String, _
hModule As Long, _
ByVal dwFlags As Long) As Long


Public Function PlayWavFile(WavFile As String) As String
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
PlaySound WavFile, 0, SND_ASYNC Or SND_FILENAME
PlayWavFile = ""
End Function


call it like


PlayWavFile ("C:\Windows\Media\Microsoft Office 2000\Chimes.wav")


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Conan Kelly" <CTBarbarin at msn dot com wrote in message
...
Hello all,

Can I use VBA to play a WAV file or some other sound file format? I do

not want the playing of this sound to open up an external
media player and be played inside of it, I want it to be a sound that just

plays (like Windows and other programs events sounds).

--
Thanks for any help anyone can provide,

Conan Kelly




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Play Sound File Soniya[_4_] Excel Programming 0 February 22nd 06 10:46 AM
Alarm, Play wav file Alfie_40 Excel Programming 2 October 14th 05 06:45 PM
Play avi file in a Frame Frank Excel Programming 0 January 19th 05 02:25 PM
How play a wav file Scott Excel Programming 2 April 21st 04 08:32 PM
Macro to play wave file yo beee Excel Programming 1 October 29th 03 11:42 PM


All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"