PC Review


Reply
Thread Tools Rate Thread

Can sounds be played when cell value changes?

 
 
=?Utf-8?B?UnViZW4=?=
Guest
Posts: n/a
 
      24th Jul 2007
I was wondering if it is possible to play a wav file when the value of a cell
changes.
If so, how can I do this?
Any suggestions would help, thanks!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      24th Jul 2007
This should do it. In your worksheet place this code...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
PlayWavFile "C:\Windows\Media\Microsoft Office 2000\Chimes.wav"
End If
End Sub

In a standard Code Module add this code...
'*******************************************
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
'**************************************************

--
HTH...

Jim Thomlinson


"Ruben" wrote:

> I was wondering if it is possible to play a wav file when the value of a cell
> changes.
> If so, how can I do this?
> Any suggestions would help, thanks!

 
Reply With Quote
 
N10
Guest
Posts: n/a
 
      24th Jul 2007

"Ruben" <(E-Mail Removed)> wrote in message
news:C1911437-AA69-4B92-B386-(E-Mail Removed)...
>I was wondering if it is possible to play a wav file when the value of a
>cell
> changes.
> If so, how can I do this?
> Any suggestions would help, thanks!


Hi Ruben

You can also coax Excel to issue a vocal warning when the target cell
changes


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.Speech.Speak "The cell contents have changed"
End If
End Sub



Regards N10


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
No System Sounds are Played Joe Red Windows XP Music 0 14th Jul 2004 10:27 PM
wav sounds played with external soundcard BitzChick Windows XP Help 3 15th Feb 2004 10:41 PM
music after d/l sounds like 33 rpm played at 78rpm bentley Windows XP Music 0 16th Nov 2003 03:22 AM
Freelancer skips when sounds are played Neil Page Windows XP Games 6 20th Sep 2003 02:15 PM
Music sounds low when played on the net Crystal Windows XP Music 0 11th Jul 2003 01:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:09 AM.