Following is the code which I use, but I am not able to fetch data and excel is giving me an error. Any idea what it could it might be?
reference links:
it has to fetch PE ROE and PB numerical values.
Any assistance would be highly appreciated! Thanks
reference links:
VBA Code:
Option Explicit
Public Sub GetInfo()
Dim s As String, ids(), i As Long
ids = Array(500125, 500325)
With CreateObject("MSXML2.XMLHTTP")
For i = LBound(ids) To UBound(ids)
.Open "GET", "https://api.bseindia.com/BseIndiaAPI/api/ComHeader/w?quotetype=EQ&scripcode=" & ids(i) & "&seriesid=", False
.send
s = .responseText
ActiveSheet.Cells(i + 1, 1) = Split(Split(s, """ROE"":""")(1), Chr$(34))(0)
ActiveSheet.Cells(i + 1, 2) = Split(Split(s, """PE"":""")(1), Chr$(34))(0)
ActiveSheet.Cells(i + 1, 3) = Split(Split(s, """PB"":""")(1), Chr$(34))(0)
Next
End With
End Sub
it has to fetch PE ROE and PB numerical values.
Any assistance would be highly appreciated! Thanks