Hello guys,
I'm trying to read a block of words from a ControlLogix into Excel using a DDE channel. In Excel, i'm using a macro activated by a button to do the reading. The code is in VBA. I found the code in RSLinx help, here it is:
"Excel DDE macro: read a block of words
Reading data from a PLC via DDE requires a macro like the following. This macro assumes that there is a worksheet created and saved as RSLINXXL.XLS. This is the destination of the data that will be read by the macro. This routine reads a block of five words:
Sub Block_Read()
I wrote exactly that code and when I activate the macro, I get the "error 438: Property or method not supported/managed by the object." If I click on debug, it higlights the line with the DDERequest command.
Do you know how to get rid of that error?????
Thank you very much
Marie
I'm trying to read a block of words from a ControlLogix into Excel using a DDE channel. In Excel, i'm using a macro activated by a button to do the reading. The code is in VBA. I found the code in RSLinx help, here it is:
"Excel DDE macro: read a block of words
Reading data from a PLC via DDE requires a macro like the following. This macro assumes that there is a worksheet created and saved as RSLINXXL.XLS. This is the destination of the data that will be read by the macro. This routine reads a block of five words:
Sub Block_Read()
'open dde link: testsol=DDE Topic
RSIchan = DDEInitiate("RSLinx", "testsol")
'get data and store in data variable
data = DDERequest(RSIchan, "N7:30,L5,C1")
'Paste data into selected range
Range("[RSLINXXL.XLS]DDE_Sheet!A7:A11").Value = data
'close dde link
DDETerminate (RSIchan)
End Sub "RSIchan = DDEInitiate("RSLinx", "testsol")
'get data and store in data variable
data = DDERequest(RSIchan, "N7:30,L5,C1")
'Paste data into selected range
Range("[RSLINXXL.XLS]DDE_Sheet!A7:A11").Value = data
'close dde link
DDETerminate (RSIchan)
I wrote exactly that code and when I activate the macro, I get the "error 438: Property or method not supported/managed by the object." If I click on debug, it higlights the line with the DDERequest command.
Do you know how to get rid of that error?????
Thank you very much
Marie