Assign a sound to a variable

H

Howard

This is a shortened list of sounds in column R, sheet 1. And is the list for a data validation drop down in H1.

C:\Windows\Media\ir_end.wav
C:\Windows\Media\ringout.wav
C:\Windows\Media\Speech Misrecognition.wav

This is in Module 1:

Option Explicit

Private Declare Function sndPlaySound Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_LOOP = &H8
Const SND_PURGE = &H40

Public Sub SoundPlayAsyncOnce(Sound As String)
'SND_SYNC to play assynchron
sndPlaySound Sound, SND_ASYNC
End Sub


This is in sheet1 vb editor:

Option Explicit

Private Declare Function sndPlaySound32 _
Lib "winmm.dll" _
Alias "sndPlaySoundA" ( _
ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Sub TingleTunes()

'Dim iSnd As string
'Set iSnd = Range("H1").Value
'SoundPlayAsyncOnce iSnd.Value
'SoundPlayAsyncOnce iSnd.Value

SoundPlayAsyncOnce ActiveCell.Value
End Sub

As is, it works fine to select a sound in R column and run Sub TingleTunes().

The commented out code lines is my attempt to select a sound from the drop down and run TingleTunes to play the selected sound.

I get object required error.

Thanks.
Howard
 
C

Claus Busch

Hi Howard,

Am Tue, 7 May 2013 23:56:21 -0700 (PDT) schrieb Howard:
The commented out code lines is my attempt to select a sound from the drop down and run TingleTunes to play the selected sound.

in a standard module:

Option Explicit
Private Declare Function sndPlaySound Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_LOOP = &H8
Const SND_PURGE = &H40

Public Sub SoundPlayAsyncOnce(Sound As String)
'SND_SYNC to play assynchron
sndPlaySound Sound, SND_ASYNC
End Sub

In the code module of sheet1:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$H$1" Then
SoundPlayAsyncOnce Target.Value
End If
End Sub


Regards
Claus Busch
 
H

Howard

Hi Howard,



Am Tue, 7 May 2013 23:56:21 -0700 (PDT) schrieb Howard:






in a standard module:



Option Explicit

Private Declare Function sndPlaySound Lib "winmm.dll" _

Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _

ByVal uFlags As Long) As Long



Const SND_SYNC = &H0

Const SND_ASYNC = &H1

Const SND_LOOP = &H8

Const SND_PURGE = &H40



Public Sub SoundPlayAsyncOnce(Sound As String)

'SND_SYNC to play assynchron

sndPlaySound Sound, SND_ASYNC

End Sub



In the code module of sheet1:



Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$H$1" Then

SoundPlayAsyncOnce Target.Value

End If

End Sub





Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2

As simple as that!

Thanks, Claus.

Regards,
Howard
 
C

Claus Busch

Hi Howard,

Am Wed, 8 May 2013 01:08:18 -0700 (PDT) schrieb Howard:
As simple as that!

sound is declared as string. And only objects will be set.
If you want play your complete list in A then you could try it so:

Sub Test()
Dim iSnd As String
Dim i As Long
For i = 1 To 10
iSnd = Cells(i, 1).Value
SoundPlayAsyncOnce iSnd
Application.Wait Now + TimeValue("00:00:02")
Next
End Sub


Regards
Claus Busch
 
H

Howard

Hi Howard,



Am Wed, 8 May 2013 01:08:18 -0700 (PDT) schrieb Howard:






sound is declared as string. And only objects will be set.

If you want play your complete list in A then you could try it so:



Sub Test()

Dim iSnd As String

Dim i As Long

For i = 1 To 10

iSnd = Cells(i, 1).Value

SoundPlayAsyncOnce iSnd

Application.Wait Now + TimeValue("00:00:02")

Next

End Sub





Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2

Thanks again, Claus.

That snippet is a nice little demo.

Regards,
Howard
 
C

CellShocked

Hi Howard,

Am Wed, 8 May 2013 01:08:18 -0700 (PDT) schrieb Howard:


sound is declared as string. And only objects will be set.
If you want play your complete list in A then you could try it so:

Sub Test()
Dim iSnd As String
Dim i As Long
For i = 1 To 10
iSnd = Cells(i, 1).Value
SoundPlayAsyncOnce iSnd
Application.Wait Now + TimeValue("00:00:02")
Next
End Sub


Regards
Claus Busch


It would be cool if it could "play" in a similar fashion as that of
"BURG" the boot loader app for Linux distros and other PC operating
systems. It uses numeric values for the tone frequencies and duration
numerics for the time. My PC plays "Fur Elise" when it boots. If I used
it at work, I could tell if someone reboots a bench PC or such (until
they press a key anyway).
 
C

Claus Busch

Hi,

Am Wed, 08 May 2013 05:33:01 -0700 schrieb CellShocked:
It would be cool if it could "play" in a similar fashion as that of
"BURG" the boot loader app for Linux distros and other PC operating
systems. It uses numeric values for the tone frequencies and duration
numerics for the time. My PC plays "Fur Elise" when it boots. If I used
it at work, I could tell if someone reboots a bench PC or such (until
they press a key anyway).

you can list the frequencies and then play a little sound. Have a try
and modify or enlarge the code:

Option Explicit
Option Compare Text
' *******************************************************
' Peter Haserodt 2003
' kleine Spielereien mit Tönen
' Viel Spass beim Ausprobieren und Studieren und Ergänzen
' *******************************************************
' ########### Frequenzen der Töne #### ohne Garantie ###########
Const c_C = 261
Const c_Cis = 277
Const c_Des = 277
Const c_D = 293
Const c_Dis = 311
Const c_Es = 311
Const c_E = 329
Const c_F = 349
Const c_Fis = 370
Const c_Ges = 370
Const c_G = 392
Const c_Gis = 415
Const c_As = 415
Const c_A = 440
Const c_Ais = 466
Const c_B = 466
Const c_H = 494
' ###########
' API-Deklaration

Private Declare Function Beep Lib "kernel32" _
(ByVal dwFreq As Long, ByVal dwDuration As Long) _
As Long

Private Function GibFrequenz(ByVal DerBuchstabe As String) As Long
Select Case DerBuchstabe
Case "C": GibFrequenz = c_C
Case "Cis": GibFrequenz = c_Cis
Case "Des": GibFrequenz = c_Des
Case "D": GibFrequenz = c_D
Case "Dis": GibFrequenz = c_Dis
Case "Es": GibFrequenz = c_Es
Case "E": GibFrequenz = c_E
Case "F": GibFrequenz = c_F
Case "Fis": GibFrequenz = c_Fis
Case "Ges": GibFrequenz = c_Ges
Case "G": GibFrequenz = c_G
Case "Gis": GibFrequenz = c_Gis
Case "As": GibFrequenz = c_As
Case "A": GibFrequenz = c_A
Case "Ais": GibFrequenz = c_Ais
Case "B": GibFrequenz = c_B
Case "H": GibFrequenz = c_H
End Select
End Function

Sub PlayALittleSong()
Dim fTon(8, 2), i As Integer
' ######## Feld Fuellen, würde man natürlich aus ner Textdatei oder so
holen
fTon(0, 0) = "e": fTon(0, 1) = 8: fTon(0, 2) = 1
fTon(1, 0) = "dis": fTon(1, 1) = 8: fTon(1, 2) = 1
fTon(2, 0) = "e": fTon(2, 1) = 4: fTon(2, 2) = 1
fTon(3, 0) = "dis": fTon(3, 1) = 8: fTon(3, 2) = 1
fTon(4, 0) = "e": fTon(4, 1) = 4: fTon(4, 2) = 1
fTon(5, 0) = "h": fTon(5, 1) = 8: fTon(5, 2) = 1
fTon(6, 0) = "d": fTon(6, 1) = 4: fTon(6, 2) = 1
fTon(7, 0) = "c": fTon(7, 1) = 4: fTon(7, 2) = 1
fTon(8, 0) = "a": fTon(8, 1) = 8: fTon(8, 2) = 1

For i = 0 To 8
Beep GibFrequenz(fTon(i, 0)) * fTon(i, 2), (2000 / fTon(i, 1))
Next i
End Sub


Regards
Claus Busch
 
H

Howard

Hi Claus,

I've got all codes and Public declares, Function etc... in place to play what ever is in "$H$1".

Below is a count down sub that works well on its own, and when the count down gets to whatever count down warning time selected by the user, the count down cell font turns red and continues counting down until 0, the enters "Time Up!"

I have tried to find a place in the count down code to place the equivalent
of "SoundPlayAsyncOnce Target.Value" so the code will play whatever is in
"$H$1" at the same time as the code turns the font red in the count down cell.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$H$1" Then
SoundPlayAsyncOnce Target.Value
End If
End Sub

Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Status As Boolean

Private Sub cmdStart_Click()
Status = True
Dim i As Integer
Dim WarningTime As Integer
Dim Period As Double
Dim MyTime As Double

With Sheets("Main")
If (.Cells(5, 1) = "") Then
WarningTime = .Cells(5, 4)
Else
WarningTime = .Cells(5, 1)
End If

If (.Cells(8, 1) = "") Then
Period = .Cells(8, 4)
Else
Period = .Cells(8, 1)
End If
End With

If (Period < 0.01) Then Period = 0.01

With Sheets("Counter").Cells(2, 1)

.FormatConditions.Delete
.FormatConditions.Add xlCellValue, xlLessEqual, WarningTime


With .FormatConditions(1).Font
.Bold = True
.ColorIndex = 3

End With
.NumberFormat = Choose(Log(Period) / Log(10) + 3, "0.00", "0.0", "0")

.Value = Sheets("Main").Cells(2, 1).Value + Period

Sheets("Counter").Activate
While (.Value > Period And Status)
.Value = .Value - Period
MyTime = .Value
For i = 1 To 100 * Period
Sleep 10
MyTime = MyTime - 0.01
If (MyTime <= 0) Then Exit For
DoEvents
Next i
Wend
If (.Value <= Period) Then .Value = "Time Up!"
End With
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If (Target.Row = 2 And Target.Column = 1) Then
Cells(5, 1).Value = Cells(5, 4).Value
End If
End Sub

Thanks.
Howard
 
C

Claus Busch

Hi Howard,

Am Wed, 8 May 2013 12:37:55 -0700 (PDT) schrieb Howard:
I have tried to find a place in the count down code to place the equivalent
of "SoundPlayAsyncOnce Target.Value" so the code will play whatever is in
"$H$1" at the same time as the code turns the font red in the count down cell.

on which sheet is the button "Start"?
Private Sub Worksheet_Change(ByVal Target As Range)
If (Target.Row = 2 And Target.Column = 1) Then
Cells(5, 1).Value = Cells(5, 4).Value
End If
End Sub

and on which sheet is this Worksheet_Change-Event?


Regards
Claus Busch
 
H

Howard

Hi Howard,



Am Wed, 8 May 2013 12:37:55 -0700 (PDT) schrieb Howard:








on which sheet is the button "Start"?










and on which sheet is this Worksheet_Change-Event?





Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2

Hi Claus,

Button START in on sheet named Main.

The Change Event code I posted here is NOT used in this case. I just postedit to sort of show that I wanted to play a sound (which I can choose from a drop down) and play it in the timer count down code I posted. Sorry, I sure did not make that clear.

To add, I can't find if this statement - SoundPlayAsyncOnce - will stop thecode to play the sound or plays the sound while the code continues. Thereis another similar statement like this one and I cannot find where I read which was which. In the end, I prefer to keep code running and play sound.

Howard
 
C

Claus Busch

Hi Howard,

Am Wed, 8 May 2013 23:39:17 -0700 (PDT) schrieb Howard:
Button START in on sheet named Main.

The Change Event code I posted here is NOT used in this case. I just posted it to sort of show that I wanted to play a sound (which I can choose from a drop down) and play it in the timer count down code I posted. Sorry, I sure did not make that clear.

To add, I can't find if this statement - SoundPlayAsyncOnce - will stop the code to play the sound or plays the sound while the code continues. There is another similar statement like this one and I cannot find where I read which was which. In the end, I prefer to keep code running and play sound.

try:
For i = 1 To 100 * Period
MyTime = MyTime - 0.01
SoundPlayAsyncOnce Sheets("Counter").Range("H1").Text
If (MyTime <= 0) Then Exit For
DoEvents
Next i


Regards
Claus Busch
 
H

Howard

Hi Howard,



Am Wed, 8 May 2013 23:39:17 -0700 (PDT) schrieb Howard:






try:

For i = 1 To 100 * Period

MyTime = MyTime - 0.01

SoundPlayAsyncOnce Sheets("Counter").Range("H1").Text

If (MyTime <= 0) Then Exit For

DoEvents

Next i





Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2

That did not work. Did you meant to omit the -Sleep 10- line?
Without it, the count down is very quick, I'm using 10 seconds in my test runs and w/o Sleep 10, it counts down in about 1 second. I added Sleep backin and runs normal, but no sound at all.

(note a typo in my previous post, sound string is actually in F1 of Main and Counter sheets, I changed it in my tests here)

And I tried both sheets F1's as you can see below Counter is commented out to see if it would work on Main. No go either sheet.

For i = 1 To 100 * Period
Sleep 10
MyTime = MyTime - 0.01
'SoundPlayAsyncOnce Sheets("Counter").Range("F1").Text
SoundPlayAsyncOnce Sheets("Main").Range("F1").Text
If (MyTime <= 0) Then Exit For
DoEvents
Next I

However, unless I'm going crazy, as I ponder what to try next or as I made the change to play on Main instead of Counter... the sound suddenly plays. Seems like it will play after the code has run, but waits for a few moments, perhaps as long as the 10 seconds I am using in the tests, then plays...????

Howard
 
H

Howard

However, unless I'm going crazy, as I ponder what to try next or as I made the change to play on Main instead of Counter... the sound suddenly plays.. Seems like it will play after the code has run, but waits for a few moments, perhaps as long as the 10 seconds I am using in the tests, then plays....????



Howard

Regarding the "stray" sound playing, it plays AFTER the code has run and ONLY if I make a change to the code.

Not sure if that is useful info or not.

Howard
 
C

Claus Busch

Hi Howard,

Am Thu, 9 May 2013 01:26:34 -0700 (PDT) schrieb Howard:
Regarding the "stray" sound playing, it plays AFTER the code has run and ONLY if I make a change to the code.

what values you have for WarningTime and Period?
Try in a standard module:

Private Declare Function sndPlaySound Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_LOOP = &H8
Const SND_PURGE = &H40

Public Sub SoundPlayAsyncLoop(Sound As String)
'SND_SYNC für synchrones Abspielen.
sndPlaySound Sound, SND_ASYNC Or SND_LOOP
End Sub
Public Sub SoundPlayAsyncOnce(Sound As String)
'SND_SYNC für synchrones Abspielen.
sndPlaySound Sound, SND_ASYNC
End Sub
Public Sub SoundStop()
sndPlaySound 0, SND_PURGE
End Sub

And in sheet "Main":

Sheets("Counter").Activate
While (.Value > Period And Status)
SoundPlayAsyncLoop .Range("H1").Value
.Value = .Value - Period
MyTime = .Value
For i = 1 To 100 * Period
Sleep 10
MyTime = MyTime - 0.01
If (MyTime <= 0) Then
SoundStop
Exit For
End If
DoEvents
Next i
Wend
If (.Value <= Period) Then
SoundStop
.Value = "Time Up!"
End If


Regards
Claus Busch
 
H

Howard

<what values you have for WarningTime and Period? >
Warning time = 6 and Period = 0.2

Below is what I read your instruction to be, nothing else in either module or sheet vb editor.

This is what is in Main:

Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Status As Boolean


Private Sub cmdStart_Click()
Status = True
Dim i As Integer
Dim WarningTime As Integer
Dim Period As Double
Dim MyTime As Double

Sheets("Counter").Activate
While (.Value > Period And Status)

SoundPlayAsyncLoop .Range("H1").Value

.Value = .Value - Period
MyTime = .Value


For i = 1 To 100 * Period
Sleep 10
MyTime = MyTime - 0.01


If (MyTime <= 0) Then

SoundStop
Exit For
End If

DoEvents
Next i
Wend
If (.Value <= Period) Then

SoundStop
.Value = "Time Up!"
End If
End Sub


This is what is in the standard module:

Option Explicit

Private Declare Function sndPlaySound Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_LOOP = &H8
Const SND_PURGE = &H40


Public Sub SoundPlayAsyncLoop(Sound As String)
'SND_SYNC f�r synchrones Abspielen.
sndPlaySound Sound, SND_ASYNC Or SND_LOOP
End Sub

Public Sub SoundPlayAsyncOnce(Sound As String)

'SND_SYNC f�r synchrones Abspielen.

sndPlaySound Sound, SND_ASYNC
End Sub

Public Sub SoundStop()
sndPlaySound 0, SND_PURGE
End Sub

When I click the start button get an error "Invalid or Unqualified Reference" and ".Value" in the line here is blue highlighted.

While (.Value > Period And Status)
 
C

Claus Busch

Hi Howard,

Am Thu, 9 May 2013 02:06:00 -0700 (PDT) schrieb Howard:
<what values you have for WarningTime and Period? >
Warning time = 6 and Period = 0.2

it sounds not really good, but for me it works.

In the standard module:

Option Explicit
Private Declare Function sndPlaySound Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_LOOP = &H8
Const SND_PURGE = &H40

Public Sub SoundPlayAsyncLoop(Sound As String)
'SND_SYNC für synchrones Abspielen.
sndPlaySound Sound, SND_ASYNC Or SND_LOOP
End Sub
Public Sub SoundPlayAsyncOnce(Sound As String)
'SND_SYNC für synchrones Abspielen.
sndPlaySound Sound, SND_ASYNC
End Sub
Public Sub SoundStop()
sndPlaySound 0, SND_PURGE
End Sub

In code module of sheet "Main":

Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Status As Boolean

Private Sub cmdStart_Click()
Dim i As Integer
Dim WarningTime As Integer
Dim Period As Double
Dim MyTime As Double

Status = True
With Sheets("Main")
If .Cells(5, 1) = "" Then
WarningTime = .Cells(5, 4)
Else
WarningTime = .Cells(5, 1)
End If

If .Cells(8, 1) = "" Then
Period = .Cells(8, 4)
Else
Period = .Cells(8, 1)
End If
End With

If (Period < 0.01) Then Period = 0.01

With Sheets("Counter").Cells(2, 1)

.FormatConditions.Delete
.FormatConditions.Add xlCellValue, xlLessEqual, WarningTime

With .FormatConditions(1).Font
.Bold = True
.ColorIndex = 3
End With
.NumberFormat = Choose(Log(Period) / Log(10) + 3, "0.00", "0.0", "0")
.Value = Sheets("Main").Cells(2, 1).Value + Period

Sheets("Counter").Activate
While (.Value > Period And Status)
SoundPlayAsyncLoop Sheets("Main").Range("F1").Text
.Value = .Value - Period
MyTime = .Value
For i = 1 To 100 * Period
Sleep 10
MyTime = MyTime - 0.01
If (MyTime <= 0) Then Exit For
DoEvents
Next i
Wend
If (.Value <= Period) Then
SoundStop
.Value = "Time Up!"
End If
End With
End Sub


Regards
Claus Busch
 
C

Claus Busch

Hi Howard,

Am Thu, 9 May 2013 11:28:36 +0200 schrieb Claus Busch:
In code module of sheet "Main":
Status = True
With Sheets("Main")
If .Cells(5, 1) = "" Then
WarningTime = .Cells(5, 4)
Else
WarningTime = .Cells(5, 1)
End If

it sounds better when you start playing pressing the button:

With Sheets("Main")
SoundPlayAsyncLoop .Range("F1").Text
If .Cells(5, 1) = "" Then
WarningTime = .Cells(5, 4)
Else
WarningTime = .Cells(5, 1)
End If

The rest of the code stays unchanged


Regards
Claus Busch
 
H

Howard

In code module of sheet "Main":
it sounds better when you start playing pressing the button:



With Sheets("Main")

SoundPlayAsyncLoop .Range("F1").Text

If .Cells(5, 1) = "" Then

WarningTime = .Cells(5, 4)

Else

WarningTime = .Cells(5, 1)

End If



The rest of the code stays unchanged

Still not working as I would like. And I am willing to accept the fact that it may not be sensible to keep flogging away at it.

Here is a drop box link to my workbook. I think it to be as you have instructed.

'https://www.dropbox.com/s/wih9sybw3zzqhb3/Sound Off A Few Sounds Drop Box.xlsm

There are notes to myself on Main sheet that me be of use to you, maybe not..

The main thing I was going after is to play a sound at the same time as thecount down value in Counter sheet turns red.
Currently the sound plays only after count down value is 0 and "Time Up" appears.

The background pulsating sounds as the timer counts down needs to be eliminated, if possible. If not possible then probably no need to continue efforts with this project.

If it is normal NOT to be able to use the Main or Counter sheets for routine excel stuff, like entering values, or formulas, doing color formatting, cell formatting etc., then I am OK with that. HANDS OFF while count down isin progress is fine. Just need to know if that is the situation.

If the count down MUST stop to play the sound (again play sound at the designated count down value not at the end) and then resume after sound is played, that is also OK.

I appreciate you effort and time, but if it is time to pull the plug on this I have no problem. I fully respect your judgment as to whether to or notput any more energy into this.

Thanks.
Howard
 
C

Claus Busch

Hi Howard,
The main thing I was going after is to play a sound at the same time as the count down value in Counter sheet turns red.
Currently the sound plays only after count down value is 0 and "Time Up" appears.

The background pulsating sounds as the timer counts down needs to be eliminated, if possible. If not possible then probably no need to continue efforts with this project.

if you want to play the sound if the value turns red, you have to put an
IF-Statement into the Loop and so you will have the pulsating sound
If it is normal NOT to be able to use the Main or Counter sheets for routine excel stuff, like entering values, or formulas, doing color formatting, cell formatting etc., then I am OK with that. HANDS OFF while count down is in progress is fine. Just need to know if that is the situation.

If the count down MUST stop to play the sound (again play sound at the designated count down value not at the end) and then resume after sound is played, that is also OK.

Load down your workbook "Sound of a few sounds" and/or "Howard_Sound"
from:
https://skydrive.live.com/#cid=9378AAB6121822A3&id=9378AAB6121822A3!191

In your workbook the sound starts now when time in A2 <= WarningTime but
it is pulsating. In Howard_Sound the sound plays all the time but it
sounds good.


Regards
Claus Busch
 
H

Howard

Hi Howard,







if you want to play the sound if the value turns red, you have to put an

IF-Statement into the Loop and so you will have the pulsating sound






Load down your workbook "Sound of a few sounds" and/or "Howard_Sound"

from:

https://skydrive.live.com/#cid=9378AAB6121822A3&id=9378AAB6121822A3!191



In your workbook the sound starts now when time in A2 <= WarningTime but

it is pulsating. In Howard_Sound the sound plays all the time but it

sounds good.





Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2


Hi Claus,

That is just perfect!
It never occurred to me to have the audio warning in sync with visual for the warning count down.

I'll have a look at the code change between my old and this revised winner.

You hit another one out of the ball park!

Thanks a lot.

Regards,
Howard

In your workbook the sound starts now when time in A2 <= WarningTime but
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Sound repeats unending until closing workbook 2
Wavfile playing trubcated 3
Need macro to play sound in Excel 2007 0
Adding sount to a macro 11
Alarm 2 2
playing wma files 2
applcation.run 4
WAV Files 2

Top