Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default playing sound???


is there anyway of playing a sound once a user opens my excel file??
Thanks!

--
tess45
-----------------------------------------------------------------------
tess457's Profile: http://www.excelforum.com/member.php...fo&userid=1393
View this thread: http://www.excelforum.com/showthread.php?threadid=27058

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default playing sound???

John Walkenbach's site:
http://j-walk.com/ss/excel/tips/tip59.htm
for playing a sound

Chip Pearson's site for information on the Workbook_Open Event

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"tess457" wrote in message
...

is there anyway of playing a sound once a user opens my excel file???
Thanks!!


--
tess457
------------------------------------------------------------------------
tess457's Profile:

http://www.excelforum.com/member.php...o&userid=13938
View this thread: http://www.excelforum.com/showthread...hreadid=270583



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default playing sound???

Hi Tess457,

Put this code in the workbook open event...

Private Sub Workbook_Open()
PlayWAV
End Sub

This code will play any wav you need as long as the wav is in the
same folder/directory as the workbook... just put it in a module

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

Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000

Sub PlayWAV()
WAVFile = "yoursound.wav"
WAVFile = ThisWorkbook.Path & "\" & WAVFile
Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME)
End Sub

and it shouls play your sound file when you open the workbook..

hope this helps...

ste
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
Detecting the actual playing or NOT playing of a WAV file Bajbaj Excel Discussion (Misc queries) 0 October 24th 07 09:16 PM
How do I keep the ding sound from playing when a message appears? Quinn1984 Excel Discussion (Misc queries) 2 September 12th 07 01:04 PM
Playing a sound file from entry in cell NG99 Excel Discussion (Misc queries) 2 January 31st 07 12:27 AM
Help Playing a sound if a cell's value chjanges as a result of a calculation Syd Excel Discussion (Misc queries) 1 September 2nd 06 01:36 AM
Playing a sound base on cell value Mike[_58_] Excel Programming 4 November 30th 03 03:53 AM


All times are GMT +1. The time now is 01:48 PM.

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"