这是我收到的错误消息:
这是宏,直到它停止的行
Option Explicit
Option Base 1
Sub update()
Dim wbk As Workbook 'This workbook
Set wbk = ThisWorkbook
Dim path As String
path = wbk.path
Dim oBBG As New BLP_DATA_CTRLLib.BlpData
Dim date_string As String
date_string = CStr(CLng(Now()))
Dim row As Long
Dim col As Long
Dim vtSecurities As Variant
Dim vtFields As Variant
Dim vtData As Variant
Dim d1 As Date
Dim tmp As String
With wbk.Sheets(1)
.Activate
.Cells(1, 1) = "TICKER"
.Cells(1, 2) = "LAST_PRICE"
.Cells(1, 3) = "DESCRIPTION"
.Cells(1, 4) = "CURRENCY"
.Cells(1, 5) = "PRICE_CLOSE_DATE"
.Cells(1, 6) = "LAST_UPDATE"
.Cells(1, 7) = "PX_CLOSE_DT"
d1 = Now()
.Cells(1, 8) = "Last Refresh"
.Cells(1, 9) = d1
.Cells(5, 9) = "Macro Guideline"
.Cells(6, 9) = "1- Copy Ticker in first column"
.Cells(7, 9) = "2- Click on the update button"
.Cells(8, 9) = "3- Ticker not found will be move into the Deleted Table. They will not appear in the Bloomberg Extract table."
'Find the last non-blank cell in column A(1)
row = .Cells(Rows.Count, 1).End(xlUp).row
'Find the last non-blank cell in row 1
col = .Cells(1, Columns.Count).End(xlToLeft).Column
vtSecurities = WorksheetFunction.Transpose(.Range(Cells(2, 1), Cells(row, 1)))
vtFields = Array("PX LAST", "Name", "CRNCY", "PX_LAST", "LAST_UPDATE_DT", "PX_CLOSE_DT")
**vtData = oBBG.BLPSubscribe(vtSecurities, vtFields)**
如果遗漏了任何内容,我很抱歉,我已经过验证,Bloomberg数据类型库位于选中的参考文献中。
谢谢!
答案 0 :(得分:0)
仅供参考,Bloomberg更新了他们的桌面API。所有旧的API调用都不起作用。您需要将代码更改为新的API,或者我被告知,如果您提出要求,Bloomberg可以将您的登录信息还原为旧API。