I’ve been running into the BBG Add-in “NA Requesting Data” issue when building a button that takes data from BBG, takes the inverse of them, and inputs into the cell F16 and G16.
Sub CommandButton1_Click()
Dim inversePairTicker As String
Dim bidValue As Double
Dim askValue As Double
Dim invBidValue As Double
Dim invAskValue As Double
inversePairTicker = Range("E13").Value
If inversePairTicker = "" Then
Range("F16").Formula = "=BDP(E9 & "" BGN Curncy"", ""RQ002"")"
Range("G16").Formula = "=BDP(E9 & "" BGN Curncy"", ""RQ004"")"
Else
With Worksheets("Inv Pair Calc")
.Range("E4").Formula = "=BDP(""" & inversePairTicker & " BGN Curncy"", ""RQ002"")"
.Range("F4").Formula = "=BDP(""" & inversePairTicker & " BGN Curncy"", ""RQ004"")"
bidValue = .Range("E4").Value
askValue = .Range("F4").Value
invBidValue = 1 / askValue
invAskValue = 1 / bidValue
End With
Range("F16").Value = invBidValue
Range("G16").Value = invAskValue
End If
End Sub
My E4 and F4 cells in Inv Pair Calc sometimes give rise to #NA Requesting Data, which stopped the flow of the code. I have to exit the error page, click the refresh button on bloomberg addin to actually get the data from BBG and fill it into E4 and F4 (remove the NA error). And I have click this command button again in order to populate my target cell F16 and G16. Any idea how to fix it?
I’ve confirmed with BBG that there’s nothing wrong with the add-in. Thank you!