autoupdating dde links based on modifiable cells

Ntommyb

New Member
Joined
Aug 9, 2008
Messages
3
Ok I'm a complete noob, I've cannibalized my fair share of other people's code in my time though to make my life easier. I have to say I love playing with excel and vba. I'm a controls engineer for the automotive industry so really I deal with a different kind of code completely. A couple years ago I found out you can link through the dde to Rslogix and I've been playing with it ever since.

I made a cycle timer a long time ago that I found just wasn't versatile enough for what I wanted so I tried to mess around with it to make it auto update and change dde links based on configurable cell values. That I found really hard to do just using the & because it just doesn't like it.

Basiclly what I'm trying to do is put together a link that looks like this

=(RSLINX|MF11!'_020S01_Cycle_History[1],L1,C1')

That will get me to the data I want to display. That works fine but I want to be able to assign "MF11" to be whatever I have in another cell. I also want to be able to assign the 20 out of _020S01 from a drop down menu. It all works fine and good when I use the & but I have to do a =("=(RSLINX|&a1&!'_0&a2 etc etc kind of thing and it doesn't want to link that way for some reason. It displays exactly how I want it to but it doesn't link and display the value like it would if I just type the raw string.

Ok so I get to playing around because I'm a presistant little bugger and I find that I can write that same code in VBA and populate a textbox with it using

Private Sub TextBox2_Change()

TextBox2.Text = "=(RSLINX|" _
& Range("CycleTime!H24") _
& "!'" _
& "_0" _
& Range("CycleTime!H26") _
& "_OC01.oCurrentCycleAcc" _
& ",L1,C1')"

Me.Range("CycleTime!C5").Value = TextBox2.Value

End Sub

Then I used the last line to populate a cell based on the value in the text box and it links the cell fine but the textbox shows the raw text lol.

Ok it's kind of confusing but I'm a self pronounced noob, all I really want to do is make a large cycletime spread sheet that I can take to a machine and type in the topic (MF11) and the station number (20) into cells on the worksheet and have it update alot of other cells right away. I don't really want to use textboxes but I will if I have to. I'd like to just write vba code that populates it dynamiclly.

Please help a noob
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
omg it made a mess out of my post

I guess you have to allow this page to script or it just looks like garbage lol
 
Upvote 0
Me.Range("CycleTime!C5").Value = "=(RSLINX|" _
& Range("CycleTime!H24") _
& "!'" _
& "_0" _
& Range("CycleTime!H26") _
& "_OC01.oCurrentCycleAcc" _
& ",L1,C1')"

This works just fine if I put a button to activate it, took me a while to figure it out, could've used some help. Maybe this will help other people.

My newest problem is, I don't want to have to configure a topic on my current machine if its already configured on a remote machine I'm getting data for. Is there a way to link to another machine using like a //computer name/{RSLINX|topicname! data,L1,C1} type method?
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,862
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top