object/variant help needed

Please post any questions regarding the program here.

Moderator: 2020vision

object/variant help needed

Postby alrodopial » Mon Jul 08, 2013 10:21 am

Hi,
I'm trying to copy the info that marketdeph has into a variant and use this info later in a macro
My code in sheet1:

Dim WithEvents ba As BettingAssistantCom.ComClass

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Columns.Count = 16 Then
If ba Is Nothing Then
Set ba = New BettingAssistantCom.ComClass
ba.tabIndex = 0
End If
ba.getMarketDepth False
End If
End Sub
Private Sub ba_getMarketDepthComplete(ByVal MarketDepth As Variant, ByVal resultCode As String)
MarketDepthVariant = MarketDepth
End Sub

and in a module

Public MarketDepthVariant As Variant

Sub MyMACRO()
If MarketDepthVariant Is Empty Then Exit Sub
.......................
End Sub

I get error at "If MarketDepthVariant Is Empty" saying that object is required. Marketdepth is not created at all or I just can't copy it?
The ba_getMarketDepthComplete is running because in break mode i can see the resultcode is "ok" but when the mouse is over "marketdepth" i don't see anything
Any ideas?
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby alrodopial » Mon Jul 08, 2013 11:00 am

Basic mistake, the correct syntax is

If IsEmpty(MarketDepthVariant) Then Exit Sub
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm


Return to Help

Who is online

Users browsing this forum: Majestic-12 [Bot] and 37 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.