請教Excel VBA高手
這段程式碼 在Excel 2000 & EX2007 相容模式執行OK
可讀取資料
但在 Excel 2007 卻讀不到資料
不知是何原因?
Private Sub ICETRADEAPI1_NewDealReport(ByVal nDataType As Long, ByVal nDataIndex As Long)
Dim tmpRptData As TRptData
tmpRptData.nType = nDataType
tmpRptData.nIndex = nDataIndex
tmpRptData.nGridNum = m_DealRow
'Sheet1.Cells(m_DealRow, 11) = ICETRADEAPI1.GetReportString(nDataType, nDataIndex, FTR_ID)
' Sheet1.Cells(m_DealRow, 12) = ICETRADEAPI1.GetReportString(nDataType, nDataIndex, FTR_MTH)
' Sheet1.Cells(m_DealRow, 13) = ICETRADEAPI1.GetReportString(nDataType, nDataIndex, CALLPUT)
'Sheet1.Cells(m_DealRow, 14) = str(ICETRADEAPI1.GetReportValue(nDataType, nDataIndex, STRIKE_PRICE) / 1000)
' Sheet1.Cells(m_DealRow, 15) = ICETRADEAPI1.GetReportString(nDataType, nDataIndex, ORDNO)
Sheet1.Cells(m_DealRow, 16) = ICETRADEAPI1.GetReportString(nDataType, nDataIndex, BUYSELL)
Sheet1.Cells(m_DealRow, 17) = str(ICETRADEAPI1.GetReportValue(nDataType, nDataIndex, OD_PRICE) / 1000)
Sheet1.Cells(m_DealRow, 18) = str(ICETRADEAPI1.GetReportValue(nDataType, nDataIndex, DEAL_QTY))
If (m_DealRptCount = 0) Then
m_DealRptData(m_DealRptCount).nGridNum = tmpRptData.nGridNum
m_DealRptData(m_DealRptCount).nIndex = tmpRptData.nIndex
m_DealRptData(m_DealRptCount).nType = tmpRptData.nType
m_DealRptCount = m_DealRptCount + 1
Else
m_DealRptCount = UBound(m_DealRptData)
ReDim Preserve m_DealRptData(m_DealRptCount + 1)
m_DealRptData(m_DealRptCount).nGridNum = tmpRptData.nGridNum
m_DealRptData(m_DealRptCount).nIndex = tmpRptData.nIndex
m_DealRptData(m_DealRptCount).nType = tmpRptData.nType
m_DealRptCount = m_DealRptCount + 1
End If
m_DealRow = m_DealRow + 1
End Sub
|