[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cotrolling TS from VB/A



PureBytes Links

Trading Reference Links

If you  know a teeny bit of VBA you can have fun with TS - see below:

You can control TS from VBA/Excel like this:

1) Goto Tools References in the VBA IDE in Excel. Check the reference which
has "OR trading platform". Note there are a few other Omega references you
can check...

2) Call the following function with the full path of the workspace you want
to run.

3) That's it!



Anybody got any more code for controlling TS from VB?

R



public oTS As ortrade.Application

Public Function RunTradeStationWorkspace(ByVal sORW As String) As Boolean

    Dim oTSws As ortrade.Workspace

    On Error Resume Next

    Application.DisplayAlerts = False

    RunTradeStationWorkspace = False

    If Dir(sORW) <> "" Then
        If oTS Is Nothing Then
            Set oTS = New ortrade.Application
        End If
        Set oTSws = oTS.Workspaces.Open(sORW)
        oTSws.Save
        oTSws.Close
        Set oTSws = Nothing
        RunTradeStationWorkspace = True
    End If

End Function