DDE Via Excel VBA DDEInitiate, DDERequest

 
Item$ = "EURUSD"
channelNumber = Application.DDEInitiate( _
app:="MT4", _
topic:="BID")
data_array = Application.DDERequest(channelNumber, Item$)

.Cells(IDCounter, BidColumn).FormulaArray = data_array

Application.DDETerminate channelNumber

I got this code to work a few times, but now it seems to crash Excel.

Even putting in the DDE directly into a cell will crash Excel at that point, a full Start->Shutdown the operating system is required to get DDE to work again.

Anyone have success with MT4 and DDE directly through VBA?

 
PebbleTrader:
Item$ = "EURUSD"
channelNumber = Application.DDEInitiate( _
app:="MT4", _
topic:="BID")
data_array = Application.DDERequest(channelNumber, Item$)

.Cells(IDCounter, BidColumn).FormulaArray = data_array

Application.DDETerminate channelNumber

I got this code to work a few times, but now it seems to crash Excel.

Even putting in the DDE directly into a cell will crash Excel at that point, a full Start->Shutdown the operating system is required to get DDE to work again.

Anyone have success with MT4 and DDE directly through VBA?


I can get the code to work, but it will just return "N/A".
 

I determined how to get it to work.

So far the VBA code will only return the number if back in Excel a cell has the DDE formula in it:

ex.

=('MT4'|BID!EURUSD)

Otherwise the code will return "N/A".

Not very useful at the moment, as I do not want to use an Excel formula to connect to DDE.

Reason: