Sometimes I'll pump a bit of liquidity into markets that are gappy, through BA's bookmaking feature.
However, I don't want to keep watching it, or keep watching Guardian, so I was hoping that I could get Excel to 'beep' when a bet has been matched
How easy is this to implement?
Getting Excel to Beep
i use excel to close me out at the official off or various times after (delays etc). when it closes me out it plays a part of the 20th century fox music, as an audio reminder that it as fired.
its a function that is called when a certain time is reached. it took me some time to crack it so to speak. im no excel expert certainly not vba, but i think you could do something similar but im not sure how you would call the function, something would have to "appear" or change on the ba sheet.
but i think it can be done.
its a function that is called when a certain time is reached. it took me some time to crack it so to speak. im no excel expert certainly not vba, but i think you could do something similar but im not sure how you would call the function, something would have to "appear" or change on the ba sheet.
but i think it can be done.
- pdupre1961
- Posts: 410
- Joined: Fri Feb 18, 2011 8:01 pm
Add this code into your VBA module at the top.LeTiss 4pm wrote:... so I was hoping that I could get Excel to 'beep' when a bet has been matched
How easy is this to implement?
Code: Select all
Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Long
Sub Play_Wav_File(filename)
Dim sWAVFile As String
On Error GoTo Err_Play
Call PlaySound(filename, &O0, 0)
Err_Play:
If Err <> 0 Then
Err.Clear
End If
End Sub
Code: Select all
Dim fullFilePath As String
fullFilePath = "C:\Users\Paul\Bet Angel\DONUTS.wav"
Call Play_Wav_File(fullFilePath)
My apologies letiss, what a useless reply. I could have sworn I pasted the code to play a wave file. I can only assume my mind wandered about trying to think how you were going to call it from your sheet, and I just forgot.
My code is very similar to pauls. Mine was totally ripped off from another site, no work at all on my part. I think paul probably knows/understands vba, as his code is slightly different and probably more efficient.
As long it does what you need it to. Once again sorry about that.
My code is very similar to pauls. Mine was totally ripped off from another site, no work at all on my part. I think paul probably knows/understands vba, as his code is slightly different and probably more efficient.
As long it does what you need it to. Once again sorry about that.

- pdupre1961
- Posts: 410
- Joined: Fri Feb 18, 2011 8:01 pm
No, I ripped it off as well.to75ne wrote:My code is very similar to pauls. Mine was totally ripped off from another site, no work at all on my part. I think paul probably knows/understands vba, as his code is slightly different and probably more efficient.

[/quote]
No, I ripped it off as well.
Paul[/quote]
great minds plagerise the same sites
my sheet closes me out at some definite time ie 5 sec after official off. It greens/reds me up when cell o6 states ok.
In another cell ie cell p3 I have this formula =IF(ISBLANK(O6),"",10)
If cell o6 is empty cell p3 is empty (is blank do nothing). Once the time equals my close out time, and the green up command is fired, o6 states ok and p3 states 10 (is no longer blank so state 10).
In cell p5 I have this formula =Alarm(P3,">1")
Alarm is the function name,
If p3 is empty cell p5 states false(cell p3 is less than 1)
If p3 = 10 cell p5 states true (cell p3 is greater than 1)and calls the function named alarm, and about 3 sec of drums plays.
I hope I have explained okish how I get it to play, and hopefully it might help but, obviously cell o6 is no use to you, and im not sure what cells you would need to reference for individual bets that get matched.
You will probably need some more code as once it is fired it would need to be reset ready for the next bet that gets matched.
No, I ripped it off as well.

great minds plagerise the same sites

not sure/dont know. my one gets called as outlined below.buyshirts wrote:how do you get the sound to trigger when a bet is matched?
my sheet closes me out at some definite time ie 5 sec after official off. It greens/reds me up when cell o6 states ok.
In another cell ie cell p3 I have this formula =IF(ISBLANK(O6),"",10)
If cell o6 is empty cell p3 is empty (is blank do nothing). Once the time equals my close out time, and the green up command is fired, o6 states ok and p3 states 10 (is no longer blank so state 10).
In cell p5 I have this formula =Alarm(P3,">1")
Alarm is the function name,
If p3 is empty cell p5 states false(cell p3 is less than 1)
If p3 = 10 cell p5 states true (cell p3 is greater than 1)and calls the function named alarm, and about 3 sec of drums plays.
I hope I have explained okish how I get it to play, and hopefully it might help but, obviously cell o6 is no use to you, and im not sure what cells you would need to reference for individual bets that get matched.
You will probably need some more code as once it is fired it would need to be reset ready for the next bet that gets matched.