Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
14 Day Average REVISITED | Excel Discussion (Misc queries) | |||
Help with averages revisited | Excel Worksheet Functions | |||
adding sound to an excel i.e. warning if data is negative | Excel Discussion (Misc queries) | |||
Adding an embedded sound? | Excel Discussion (Misc queries) | |||
Adding Sound to Program | Excel Programming |