Excel automation bug?, clearing placed bets

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
kev
Posts: 35
Joined: Fri Apr 17, 2009 12:30 pm

Hi,

I'm using some code from this forum to clear the bets status cells in excel, however quite often I received a Run-time error "13": type mismatch. If I close the spreadsheet down and reopen, eventually everything works ok, but its a bit ropey. I'm no expert on excel or VBA and used info from the forum to paste the following into the VBA code.

Private Sub Worksheet_Calculate()
If Range("O9").Value = "PLACED" Or Range("O9").Value = "MARKET_SUSPENDED" Or Range("O9").Value = "ERROR" Or Range("O9").Value = "FAILED" Or (Range("M9").Value = 0 And Range("O9").Value = "PLACED_KILL_PENDING") Or (Range("M9").Value = 0 And Range("O9").Value = "PLACING") Then Range("O9").ClearContents
End Sub

Can anyone see the problem here (apart from my lack of excel knowledge). I'm using the spreadsheet to monitor prices and place bets under certain price conditions, with the latest version of BA and excel 2007. cheers for any help.

Kev
kev
Posts: 35
Joined: Fri Apr 17, 2009 12:30 pm

Whilst I think of it, I have another query.

I place a lay bet using fill or kill, then offset the back bet if the lay is filled. However as I'm clearing the status of these bets, the next lay goes in straight away. I want to delay this next lay until the previous back is complete if you see what I mean? Any ideas on the code for this greatly appreciated.

thanks.
donfede
Posts: 23
Joined: Wed Jul 08, 2009 3:35 pm

Maybe you have to include the "unmatched bets count"?
Cell C5
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”