Playing 2 Sounds One After The Other
Apr 14, 2014
I have the following sub for me to play sound files:
[Code] .....
Essentially what i want to do is play one sound file, then immediately play another. I am using two subs so that can be achieved as when I was using one sub the first sound didn't play as it was immediately replaced by the second sound.
The lines of code where I call my sounds are:
[Code] .....
I thought the addition of:
[Code] .....
Would allow the first sound to play, before then playing the second sound, however this doesn't seem to be the case and the second sound doesn't play at all.
View 8 Replies
ADVERTISEMENT
Jul 8, 2014
I was working on a presentation for work where I wanted to build a 'Family Feud' type board to play a game. In the board I am using activex text boxes with code that would hide the text box to reveal the answer underneath or it would show a custom shape (an X in a box) and play the buzzer sound. The code is pretty simple, first I would make the shape visible, then I would play the sound then the shape would be made invisible. If I step through the macro everything works fine, but when I run the macro, you never see the shape. It's almost as if the sound plays before the shape shows up and then it is made invisible again. I tried putting a wait and a sleep command between making the shape visible and playing the sound but that made no difference. If I remove the code to hide the shape at the end and run the macro, the sound plays and then the shape appears. Is there anyway to have the shape appear prior to or at the same time as the sound plays?
Code:
Private Sub CommandButton8_Click()
Application.ScreenUpdating = True
ActiveSheet.Shapes("First Strike").Visible = True
Play_Strike_Sound
'The previous line refers to another macro that has the code commented below. The sndPlaySound32
'function is one I picked up from cpearson.com
'sndPlaySound32 "C:\_Fin SysSoundsff-strike.wav", SND_SYNC
ActiveSheet.Shapes("First Strike").Visible = False
End Sub
View 3 Replies
View Related
Jan 28, 2010
i have a sheet where there are 2 columns of tick boxes for good/bad input. ive been able to borrow some code that saves the sheet at a date name and based on the fact that if there is one bad tick in the bad column i would like a wav file to play showing this. likewise if there are no bad ticks then a good wav file is played instead. here is my lame code that calls to modules with the actual wav play instrucions in them, named playsound1 and playsound2 :-
Private Sub worksheet_calculate()
If [A22] > 10 Then
MsgBox "Vehicle Log Saved"
Call SaveAsTodaysDate
'End If
'if =sum[d6:d16] > 1 call soundplay1 else call soundplay2
'If Range("d6:d16").Value > 1 Then
'MsgBox "your gonna crash!"
'Call SoundPlay1 Else Call SoundPlay2
End If
End Sub
View 9 Replies
View Related
Oct 20, 2004
is there anyway of playing a sound once a user opens my excel file???
View 3 Replies
View Related
Jun 2, 2006
I am trying to figure out if it is possible to retrive the list of filter criteria in each filter of the filters collection using VBA. I could trawl through the data and retrive a unique list but I think it would take longer than if I could use what is already there.
I intend to use the list in a combo box elsewhere in the workbook......it's all to stop inquisitive little users accidently changing data and whining that thier figures are misteriously wrong.....
View 5 Replies
View Related
Apr 29, 2012
I have a formula which lookups the sunset for a particular date.
Code:
sunset = WorksheetFunction.VLookup(tempws.Range("A9"), sun, 2, False
It returns a value in numeric format (eg. .8493055555555556).
I then compare it to a time vale in one of my userform textboxes.
Code:
If rental_end.Value > sunset Then
rental_end.value ="5:00 pm"
I have a suspicion that the tow different formats cannot provide accurate results in the If statement, and causing the result of the If statement to always be true, even when it should be false.
If this is indeed the case, how would one go about adjusting this code to provide proper comparison in the If statement?
View 3 Replies
View Related
Dec 20, 2008
I have an automated sort descend happening all day. The top several cells are coloured green and if a cell jumps to the top from below the green cells, I would love a warning sound. Is is possible to activate a sound if a cell changes from a colour to a non colour. Preferably if any of the cells within a range of say F2: F6 changes from green to a non colour.
If it is not possible to have a change of colour to activate the macro, I could get around it by - if any cells in a range of H2:H5 >than 1 it plays a sound.
View 9 Replies
View Related
Oct 17, 2012
I am running Excel 2003, and have already searched the forum for "MP3" without avail.
Is there a way to play a MP3 file from a Sub Procedure?
J-Walk provides a way to do it with .wav and .mid files here Excel Developer Tip: Playing Sound From Excel using functions from the "winmm.dll" library.
However, .wav files are very large and I have a sizable collection of sounds which I'd like to use. If possible I'd much prefer to use .mp3 than .wav . Is there a way to do this? Preferably without Window's Media Player popping up.
View 3 Replies
View Related
Jan 5, 2003
I'm using this simple code to play a wav file I loaded into a worksheet:
ActiveSheet.Shapes("Object 1").Select
Selection.Verb Verb = xlclose
I attached the macro to a button and it works. Now I need to stop the wave sound playing, by attaching another macro to a button. Is that possible? What syntax shall I use to stop playing the sound?
View 5 Replies
View Related
Sep 14, 2013
I'm using this simple code to play a wav file I loaded into a worksheet:
ActiveSheet.Shapes("Object 1").Select
Selection.Verb Verb = xlclose
I attached the macro to a button and it works. Now I need to stop the wave sound playing, by attaching another macro to a button. Is that possible? What syntax shall I use to stop playing the sound?
View 3 Replies
View Related
May 12, 2014
Can excel be made to play an alarm if a condition becomes true?
View 5 Replies
View Related
Aug 6, 2014
I have a spreadsheet with a database query attached (refreshing every 60 seconds) showing a stock summary by product.
I need the spreadsheet to play a .WAV file when values change. i.e.;
If cell A1 <6, play sound1.wav
If cell A2 <6, play sound1.wav
If cell A3 <6, play sound2.wav
If cell A4 <6, play sound2.wav
This may need to be repeated several times based on certain criteria. I have a total of about 30 cells which I need to be looked at individually (not a sum of) and to play the relevant sound.
I have seen different people try to tackle this in different ways. The ideal way would be creating alarms in VBA and triggering them using a formula, but I cannot get these to work in Excel 2010 or 2013.
View 6 Replies
View Related
May 7, 2013
I have a date base that is used as a job status board developed in excel that has locations, times, clock and other areas. What I am looking for is a way of playing a sound when the time approaches 5 min before the time in the excel cell that has been entered into the job status board...
View 3 Replies
View Related