LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Adding Sound to Program Revisited

Your code worked fine for me. (it performed as I would expect based on how
it is written).

Do you have the code in the sheet module?

Is your sound turned on?

Is the value in I1 of the sheet containing the code increasing?

Is calculation set to automatic?

--
Regards,
Tom Ogilvy


"Carlton Patterson" wrote in message
...
OK,

while waiting for help I put this together but still couldn't get the
sound to work!

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 = "chimes.wav"
WavFile = "C:\WINDOWS\Media\chimes.wav"
Call PlaySound(WavFile, 0&, SND_ASYNC Or SND_FILENAME)
End Sub

Private Sub Worksheet_Calculate()
Static prevValue
If Range("I1").Value prevValue Then
WavFile = "chimes.wav"
WavFile = "C:\WINDOWS\Media\chimes.wav"
Call PlaySound(WavFile, 0&, SND_ASYNC Or SND_FILENAME)
prevValue = Range("I1").Value
End If
End Sub


Carlton

*** Sent via Developersdex http://www.developersdex.com ***



 
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
14 Day Average REVISITED F. Lawrence Kulchar Excel Discussion (Misc queries) 4 September 8th 08 11:54 PM
Help with averages revisited TimJames Excel Worksheet Functions 6 March 10th 08 12:20 PM
adding sound to an excel i.e. warning if data is negative CDG Excel Discussion (Misc queries) 6 March 11th 06 10:39 PM
Adding an embedded sound? Terry Pinnell Excel Discussion (Misc queries) 0 September 5th 05 12:50 PM
Adding Sound to Program Carlton Patterson Excel Programming 18 April 24th 05 11:59 PM


All times are GMT +1. The time now is 12:14 PM.

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

About Us

"It's about Microsoft Excel"