Is it possible in Excel to hyperlink a symbol to open in AB

@twin, @gautamlaungani if you are familiar with Excel VBA macros you can try to do it via OLE (you should already have one instance of AmiBroker open with a chart)

(put this sample code in the VBA "Sheet" section):

Sub AB_UpdateTicker(ticker)
    Dim oAB, oAW, oAD
    
    ' create AmiBroker object to update the ticker of the active document
    Set oAB = CreateObject("Broker.Application")
    oAB.Visible = True
    Set oAD = oAB.ActiveDocument
    Set oAW = oAB.ActiveWindow
    oAD.Name = ticker
End Sub

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Cancel = True
    AB_UpdateTicker (Target)
End Sub

This quick example will invoke the macro with a double-click on a cell where you will have tickers in Excel (modifiy it as needed).

VBA2AB

19 Likes