Specifications
RSLinx – Training Guide 65
8. The View Code option opens the Excel 97 Visual Basic environment.
• From here you will enter the code (subroutine) which will execute when you
push the button. Enter the following code into the code window as shown
below:
RSIchan = DDEInitiate("RSLinx", "testsol")
DDEPoke RSIchan, "T4:0.pre", Range("DDE_Sheet!D7")
DDETerminate (RSIchan)
9. Return to the normal Excel spreadsheet window by single clicking on the Excel icon
or Excel tab on the task bar at the bottom of your screen.
10. Your command button is still in design mode, and needs to be put into normal run
mode. To do this, click on the design mode tool on the Control Toolbox as shown
below.
Design mode
toggle button.
Enter the code
in the code
window as
shown here.