Silks URL

Please post any questions regarding the program here.

Moderator: 2020vision

Silks URL

Postby eclipse » Fri Jul 25, 2014 4:01 pm

When adding additional columns in Excel and adding Silks URL, how do you actually get it to display the silks image? Does it have to linked externally?
User avatar
eclipse
 
Posts: 226
Joined: Mon Apr 16, 2007 10:54 am
Location: S. E. England

Re: Silks URL

Postby osknows » Wed Jul 30, 2014 2:03 pm

The code below will show the silks over a cell after the market changes. Just change columns 25/26 (columns Y/Z) to be whatever cell the URL is in and where you want the image to show.

Code: Select all
Option Explicit

Dim currentMarket As String
Dim imageImported As Boolean

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngArray() As Variant
Dim i As Long
Const urlCol As Long = 25 'Column Y
Const picCol As Long = 26 'Column Z
Dim pic As object 'Dim pic As Picture
Dim shape As object 'Dim shape As shape

If Target.Columns.Count <> 16 Then Exit Sub

    Application.EnableEvents = False
    With Target.Parent
   
        rngArray = .Range("A1:BU55").Value2
       
        If rngArray(1, 1) <> currentMarket Then
            currentMarket = rngArray(1, 1)
            imageImported = False
           
            'Delete images
            For Each shape In .Shapes
                If Left(shape.Name, 6) = "Jockey" Then
                     shape.Delete
                End If
            Next shape
       
        End If
       
        If imageImported = False Then
            'Add images
            For i = 5 To Target.Rows.Count
                If InStr(1, rngArray(i, urlCol), "http://", vbTextCompare) > 0 Then
                    Set pic = .Pictures.Insert(rngArray(i, urlCol))
                    pic.ShapeRange.LockAspectRatio = msoFalse
                    pic.Width = .Cells(i, picCol).Width
                    pic.Height = .Cells(i, picCol).Height
                    pic.Top = .Cells(i, picCol).Top
                    pic.Left = .Cells(i, picCol).Left
                    pic.Name = "Jockey" & .Cells(i, picCol).Address
                    imageImported = True
                End If
            Next i
        End If
       
    End With
    Application.EnableEvents = True
   
End Sub
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Re: Silks URL

Postby eclipse » Wed Jul 30, 2014 9:27 pm

Many thanks for that.
User avatar
eclipse
 
Posts: 226
Joined: Mon Apr 16, 2007 10:54 am
Location: S. E. England


Return to Help

Who is online

Users browsing this forum: No registered users and 44 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.