I was wondering if there is any way to use the value returned from a dde link in the same code that created the link, such as
In this example, half would cause an error, as Range("A1").Value is currently #N/A, where i want it to return half the value of BAC's last price
Code:
Function half() as Double
'return the stock price of BAC from ThinkOrSwim
Range("A1").Formula = "=TOS|LAST!BAC"
half = Range("A1").Value / 2
End Sub
In this example, half would cause an error, as Range("A1").Value is currently #N/A, where i want it to return half the value of BAC's last price