Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
Hi all,
I don't know if I should be posting on Google groups or here, so forgive me if I'm not following protocol. Anyway, can someone show me how to add/play a sound to the following: Private Sub Worksheet_Calculate() If Range("I1").Value 0 Then Beep 'or msgbox 'or play sound 'or send email 'or whatever End If End Sub You'll notice that there is a "Beep" in the program but it doesn't work. Cheers Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
Beep should work (bit naff, but works). Are you sure you don't have sound
muted? -- HTH RP (remove nothere from the email address if mailing direct) "Carlton Patterson" wrote in message ... Hi all, I don't know if I should be posting on Google groups or here, so forgive me if I'm not following protocol. Anyway, can someone show me how to add/play a sound to the following: Private Sub Worksheet_Calculate() If Range("I1").Value 0 Then Beep 'or msgbox 'or play sound 'or send email 'or whatever End If End Sub You'll notice that there is a "Beep" in the program but it doesn't work. Cheers Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
Hi Bob,
I'm positive mate. Its a little strange because I'm sure it beeped the first time I executed it. Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
Hi Carlton,
Try this then Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" _ (ByVal lpszName As String, _ hModule As Long, _ ByVal dwFlags As Long) As Long Private Sub Workbook_Calculate() If Range("I1").Value 0 Then PlayWavFile "C:\Windows\Media\Microsoft Office 2000\Chimes.wav" End If End Sub 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 If this doesn't work, check mute again <g -- HTH RP (remove nothere from the email address if mailing direct) "Carlton Patterson" wrote in message ... Hi Bob, I'm positive mate. Its a little strange because I'm sure it beeped the first time I executed it. Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
Hi Bob,
I tried to add sound to the following excel program however I keep on getting an error message saying "Sub or Function not defined". Can you help? Private Sub Worksheet_Calculate() Static prevValue If Range("I1").Value prevValue Then PlayWavFile "C:\Windows\Media\Windows XP Print complete" prevValue = Range("I1").Value End If End Sub Cheers Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
Hi Bob,
I managed to get a Beep when I pasted this program into excel. So I don't understand why I the simple program I pasted earlier won't work, uhmmmmm.... Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column 2 Then Exit Sub 'A or B okay If Cells(Target.Row, 1) < Cells(Target.Row, 2) Then Beep End If End Sub Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
LOL.
There is no Workbook_Calculate event, it is Worksheet_Calculate! -- HTH RP (remove nothere from the email address if mailing direct) "Carlton Patterson" wrote in message ... Hi Bob, I managed to get a Beep when I pasted this program into excel. So I don't understand why I the simple program I pasted earlier won't work, uhmmmmm.... Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column 2 Then Exit Sub 'A or B okay If Cells(Target.Row, 1) < Cells(Target.Row, 2) Then Beep End If End Sub Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
Hee hee,
I should've seen that. Cheers mate. Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
Hello Bob,
while on the subject of sounds, is it possible to program excel to play a sound as a value increments? For example, lets say I have a cell with the current value of 1, I would like to hear a single beep. Then, if the value goes up to 2 I would like to hear another single beep and so on... Is that possible? Cheers mate. Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
If a worksheet beeps, but no one is around to hear it, does it still make a
sound? "Carlton Patterson" wrote in message ... Hi all, I don't know if I should be posting on Google groups or here, so forgive me if I'm not following protocol. Anyway, can someone show me how to add/play a sound to the following: Private Sub Worksheet_Calculate() If Range("I1").Value 0 Then Beep 'or msgbox 'or play sound 'or send email 'or whatever End If End Sub You'll notice that there is a "Beep" in the program but it doesn't work. Cheers Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
Schrodinger's spreadsheet? What sort of animal is that?
Bob "Steve Schroeder" wrote in message ... If a worksheet beeps, but no one is around to hear it, does it still make a sound? "Carlton Patterson" wrote in message ... Hi all, I don't know if I should be posting on Google groups or here, so forgive me if I'm not following protocol. Anyway, can someone show me how to add/play a sound to the following: Private Sub Worksheet_Calculate() If Range("I1").Value 0 Then Beep 'or msgbox 'or play sound 'or send email 'or whatever End If End Sub You'll notice that there is a "Beep" in the program but it doesn't work. Cheers Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#12
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
Don't make me hurt ya now :-P
"Bob Phillips" wrote in message ... Schrodinger's spreadsheet? What sort of animal is that? Bob "Steve Schroeder" wrote in message ... If a worksheet beeps, but no one is around to hear it, does it still make a sound? "Carlton Patterson" wrote in message ... Hi all, I don't know if I should be posting on Google groups or here, so forgive me if I'm not following protocol. Anyway, can someone show me how to add/play a sound to the following: Private Sub Worksheet_Calculate() If Range("I1").Value 0 Then Beep 'or msgbox 'or play sound 'or send email 'or whatever End If End Sub You'll notice that there is a "Beep" in the program but it doesn't work. Cheers Carlton *** Sent via Developersdex http://www.developersdex.com *** |
#13
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Sound to Program
I said Schrodinger's, not Schroeder's, Ernst not Steve ;-)
"Steve Schroeder" wrote in message ... Don't make me hurt ya now :-P "Bob Phillips" wrote in message ... Schrodinger's spreadsheet? What sort of animal is that? Bob "Steve Schroeder" wrote in message ... If a worksheet beeps, but no one is around to hear it, does it still make a sound? "Carlton Patterson" wrote in message ... Hi all, I don't know if I should be posting on Google groups or here, so forgive me if I'm not following protocol. Anyway, can someone show me how to add/play a sound to the following: Private Sub Worksheet_Calculate() If Range("I1").Value 0 Then Beep 'or msgbox 'or play sound 'or send email 'or whatever End If End Sub You'll notice that there is a "Beep" in the program but it doesn't work. Cheers Carlton *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene | Excel Discussion (Misc queries) | |||
adding sound to an excel i.e. warning if data is negative | Excel Discussion (Misc queries) | |||
Adding an embedded sound? | Excel Discussion (Misc queries) | |||
This may sound stupid..... | Excel Programming | |||
merging excel program with tdc finance program | Excel Programming |