greenbambootea
IS-IT--Management
I had an problem. I am doing a small project in Excel. Say that in a cell, I put something like "cqgpc|F.CLEK07!bid", the data from cqgpc is going to show in that cell and keeps updating. however, if I DONOT this (means there is no cell in the worksheet has this "cqgpc|F.CLEK07!bid"), and I use the following code try to show the data in a cell, I always get error 2015.
Sub Initiate_DDE()
Dim channelNumber As Long
myData
channelNumber = Excel.DDEInitiate("cqgpc", "F'.CLEK07")
myData = Excel.DDERequest(channelNumber, "Bid")
Sheets("sheet1").Select
Cells(1, 1).Value = myData
End Sub
However, if I keep "cqgpc|F.CLEK07!bid" in another cell, my code works and the real data do show up. Can anyone please tell me what the problem is? Thanks a lot.
Sub Initiate_DDE()
Dim channelNumber As Long
myData
channelNumber = Excel.DDEInitiate("cqgpc", "F'.CLEK07")
myData = Excel.DDERequest(channelNumber, "Bid")
Sheets("sheet1").Select
Cells(1, 1).Value = myData
End Sub
However, if I keep "cqgpc|F.CLEK07!bid" in another cell, my code works and the real data do show up. Can anyone please tell me what the problem is? Thanks a lot.