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
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: