Excel DDE Embedded reference

Simon
Simon used Ask the Experts™
on
Hi Folks
I have the following DDE link in a cell in a spreadsheet:

=RSLINX|TOPIC_NAME!TAG_NAME

This works correctly :-)

Is it possible to get the topic and tag names from another cell ?
Something like:

=RSLINX| & Sheet1.Range("A1") & "!" & Sheet1.Range("A2")

Regards Simon
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:
Hi,
pls try
=INDIRECT("=RSLINX|"&A1&"!"&A2)

Open in new window

Regards
SimonEngineer

Author

Commented:
Unfortunately this is not working for me. Here is the code that does not work:
Capture-1.PNG
SimonEngineer

Author

Commented:
This is the code that does work:
Capture-2.PNG
Engineer
Commented:
I have found a method of doing it that works for my application.
By putting the string creation into a sub and running it at startup it works correctly.

Sub MakeDDEFormulas()

    Sheet2.Cells(2, 3).Formula = "=RSLINX|" & Sheet1.Cells(2, 2) & "!" & Sheet1.Cells(2, 1) & ".I2.IP001"

End Sub

The important difference about embedding the code into a cell as opposed to running a VBA function is that once the DDE is embedded into the cell it becomes an active link and updates automatically when the values in the source change.
For my application I am not continually changing the tag name in the spreadsheet but using a separate workbook for each instance that I need to read data from, this now allows me to enter the Tag and Topic values only once for each worksheet.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Simon (https:#a42399071)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

MacroShadow
Experts-Exchange Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial