Alarm sounds when opening another workbook

Please post any questions regarding the program here.

Moderator: 2020vision

Alarm sounds when opening another workbook

Postby Interesting Ian » Fri Feb 28, 2014 1:33 pm

As a preliminary I should say I know absolutely nothing about computer programming and therefore nothing about the programming that excel uses.

Anyway I downloaded this Gruss software about a week or so ago. I'm using it to log prices into an excel spreadsheet. I wanted an alarm to go off when the odds exceed a certain value in another cell. I did a search on the net and used the following code:

http://j-walk.com/ss//excel/tips/tip87.htm

Wouldn't work at first -- I just pasted the code in the first window that came up in the programming area. But then I inserted a module and pasted it in that, and now it works with the alarm sounding continuously (looping) when a value in a cell in another sheet linked to the back odds exceeds a value in another cell.

In cell A1 in one sheet1 I have =alarm(C1,">B1")
In cell B1 is just a number which I can manually alter.
In cell C1 I have =Sheet2!$F$5

Sheet 2 is where the betfair match odds of a soccer match are imported with cell F5 being the back odds of the home team.

Anyway when cell A1 says false the alarm will go off when I switch to another sheet, or when I open another workbook. It only stops when I go back to the original sheet.

Does anyone have any suggestions as to what is possibly going wrong here? I have zero understanding of the code, but have nevertheless experimented with it, but to no avail. I conclude that computer programming seems to be resistant to an experimental approach in the absence of any understanding of the language!

Any help from anyone would be gratefully appreciated. But any help I'm afraid needs to be extraordinarily simplified so I can follow it. :)
Interesting Ian
 
Posts: 4
Joined: Wed Feb 12, 2014 5:03 pm

Postby Interesting Ian » Fri Feb 28, 2014 7:18 pm

Come on people! At the moment I can only bet on one match at the time . . which is kinda limiting. I need to be able to open a new workbook without the alarm continually sounding!

I could email the spreadsheet if anyone could have a look? It's only 18kb
Interesting Ian
 
Posts: 4
Joined: Wed Feb 12, 2014 5:03 pm

Postby crocogotter » Fri Feb 28, 2014 8:54 pm

As this seems to be an entirely Excel based issue, I'd try something like the mrexcel forum. Like you, I dabble a bit with spreadsheets without having any real understanding of the mechanics, just a decent grasp of logic, and I've found a lot of useful tips there and on other similar excel based forums.
crocogotter
 
Posts: 57
Joined: Fri Apr 08, 2011 2:27 pm

Postby Interesting Ian » Fri Feb 28, 2014 9:54 pm

crocogotter wrote:As this seems to be an entirely Excel based issue, I'd try something like the mrexcel forum. Like you, I dabble a bit with spreadsheets without having any real understanding of the mechanics, just a decent grasp of logic, and I've found a lot of useful tips there and on other similar excel based forums.


I assume the problem doesn't reside with Gruss per se, although the problem is manifesting as a consequence of the spreadsheet linking up to Gruss and betfair. So thought someone here might be familiar with the problem or the error I'm making.

I am asking at other forums and getting no responses from anyone whatsoever . .well . . apart from you.
Interesting Ian
 
Posts: 4
Joined: Wed Feb 12, 2014 5:03 pm

Postby alrodopial » Sat Mar 01, 2014 9:26 am

use the below code instead:
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


Function Alarm(Cell, Condition1, Condition2)
    Dim WAVFile As String
    Const SND_ASYNC = &H1
    Const SND_FILENAME = &H20000
    On Error GoTo ErrHandler
    If Evaluate(Cell.Value & Condition1) Then
        If Evaluate(Cell.Offset(0, 1) & Condition2) Then
            WAVFile = ThisWorkbook.Path & "\sound.wav" 'Edit this statement
            Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME)
            Alarm = True
            Exit Function
        End If
    End If
ErrHandler:
    Alarm = False
End Function


and in cell A1 the formula: =alarm(C1,">B1",">10")
if you want the sound to be played cell D1 must contain a number greater than 10
if you change it into something smaller than 10 the sound stops

not the best solution but it may be helpful
alrodopial
 
Posts: 1386
Joined: Wed Dec 06, 2006 9:59 pm

Postby Interesting Ian » Sat Mar 01, 2014 11:44 am

Hi, thanks for your response. Just got up and saw your response here and another response on another forum. The other guy suggested changing =alarm(C1,">B1") to =alarm(C1,">"&B1)

It seems to work! So hopefully I don't need to implement your suggestion. Thanks anyway :)
Interesting Ian
 
Posts: 4
Joined: Wed Feb 12, 2014 5:03 pm

Postby austingrd » Thu Mar 20, 2014 5:24 pm

changing =alarm(C1,">B1") to =alarm(C1,">"&B1)


Thanks for posting that. Looks good from my end already.
Mistakes are learning tools. Image
austingrd
 
Posts: 56
Joined: Sun Sep 15, 2013 7:22 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 28 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.