Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how can i get a wav file to play in excel xp as an alarm when a value in a
particular cell has been exceeded? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this a try... If the value in Cell A1 on the sheet that this code is
placed in is change to anything greater than 100 then the wave file plays... Option Explicit 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 Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" And Target.Value 100 Then _ PlayWavFile "C:\Windows\Media\Microsoft Office 2000\Chimes.wav" End Sub -- HTH... Jim Thomlinson "bassfisher" wrote: how can i get a wav file to play in excel xp as an alarm when a value in a particular cell has been exceeded? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Jim Thomlinson" wrote: Give this a try... If the value in Cell A1 on the sheet that this code is placed in is change to anything greater than 100 then the wave file plays... Option Explicit 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 Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" And Target.Value 100 Then _ PlayWavFile "C:\Windows\Media\Microsoft Office 2000\Chimes.wav" End Sub -- HTH... Jim Thomlinson "bassfisher" wrote: how can i get a wav file to play in excel xp as an alarm when a value in a particular cell has been exceeded? Jim, i placed the code in the worksheet, changed the cell values, but it wont' play a file! i am new to programming in excel. any help would be appreciated. thanx, bassfisher |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
See John's example http://www.j-walk.com/ss/excel/tips/tip87.htm -- Regards Ron de Bruin http://www.rondebruin.nl "bassfisher" wrote in message ... how can i get a wav file to play in excel xp as an alarm when a value in a particular cell has been exceeded? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
File:1 and File:2 -- Double Files when Opening One File | Excel Discussion (Misc queries) | |||
I saved file A over file B. Can I get file B back? | Excel Discussion (Misc queries) | |||
opening an excel file opens a duplicate file of the same file | Excel Discussion (Misc queries) | |||
I SAVED A FILE OVER ANOTHER A FILE IN EXCEL. THE OLD FILE WAS AN . | Excel Discussion (Misc queries) | |||
i received a file that reads powerpoint document file file exten. | Excel Discussion (Misc queries) |