poowoo 發表於 14-4-8 16:40

抓取嘉實DDE錯誤

請教各位先進
我用vba透過嘉實系統dde抓取想要的選擇權報價資料

程式碼大致如下

Do
y=1

    strPeriod = Right(Sheet1.Cells(y, 3), 2)   'yyyymm
    contract = Sheet1.Cells(y, 1) & strPeriod      'TXOmm
    strike = Sheet1.Cells(y, 2)
    strPrice = "=XQHNS|Quote!'" & contract & "P" & strike & ".TF-price'"
    Sheet1.Cells(y, 8) = strPrice
y=y+1
loop while .......

執行時
週選及近兩月沒問題,
遇到6月,9月,12月會顯示 "執行階段錯誤 13: 型態不符合"的錯誤訊息

但逐行執行的時候能正確抓到資料

找不出蟲在哪懇請賜教{:4_154:}
頁: [1]
查看完整版本: 抓取嘉實DDE錯誤