Posting this query on behalf of an external client:
The following VBA function stopped worked for me: Function Reuters_IDN(Sec As String, Field As String)
Dim res As Variant
res = "Retrieving..."
While res = "Retrieving..."
res = Application.Run("RtGet", "IDN", Sec, Field, "")
DoEvents
Application.RTD.RefreshData
Wend
Reuters_IDN = res
End Function
How could this be used via workspace?
Client cannot send full code due to confidentiality:
Private Sub LoadReutersButton_Click()
Debug.Print "LoadReutersButton Clicked"
Dim sws As Worksheet
Dim r As Range
Dim c As Range
Set sws = Worksheets("Secs")
'Clear source price 1&2&3 price
Set r = Range(sws.Cells(sRow, ColPos.cSPVendor1), sws.Cells(lastRow(), ColPos.cSPVendor1))
For Each c In r
If c = "Reuters" Then
sws.Cells(c.row, ColPos.cSPPrice1).ClearContents
End If
Next c
Set r = Range(sws.Cells(sRow, ColPos.cSPVendor2), sws.Cells(lastRow(), ColPos.cSPVendor2))
For Each c In r
If c = "Reuters" Then
sws.Cells(c.row, ColPos.cSPPrice2).ClearContents
End If
Next c
Set r = Range(sws.Cells(sRow, ColPos.cSPVendor3), sws.Cells(lastRow(), ColPos.cSPVendor3))
For Each c In r
If c = "Reuters" Then
sws.Cells(c.row, ColPos.cSPPrice3).ClearContents
End If
Next c
Application.StatusBar = "Updating Reuters Prices"
Prices_Reuters
Application.StatusBar = ""
Debug.Print "LoadReutersButton Done"
End Sub
Function Reuters_IDN(Sec As String, Field As String)
Dim res As Variant
res = "Retrieving..."
While res = "Retrieving..."
res = Application.Run("RtGet", "IDN", Sec, Field, "")
DoEvents
Application.RTD.RefreshData
Wend
Reuters_IDN = res
End Function