3.1. Visual Basic Format (Microsoft Excel 97/2000)

The format for a Microsoft Excel 97/2000 procedure that performs a setpoint is:

  1.  Enter the Sub procedure name on the first line.

  2. Enter channel= Application.DDEInitiate("cwserv","point") on the second line to open the CWSERV channel.

  3.  Enter Application.DDEPoke channel, "<point_id>.<attribute>", <sheet location> for each setpoint you want to perform.

  4. Enter Application.DDETerminate channel to close the channel.

  5. Enter End Sub to terminate the Sub procedure.

Macro Example

Sub Poke()

channel = Application.DDEInitiate( app:="cwserv", topic:="point")

Set rangeToPoke = Worksheets("Sheet1").Range("A1")

Application.DDEPoke channel, "POINT1.value", rangeToPoke

Application.DDETerminate channel

End Sub

More information

3. Modify point data.