Skip to main content
Note: For a list of DDE commands, check out the support article listing WinWedge DDE Commands. WinWedge makes it very easy for Excel to communicate with the device. This isn’t limited to simply logging data from the device to Excel, but WinWedge also enables Excel to send data directly from VBA using WinWedge’s SENDOUT and SEND DDE Commands

VBA code examples

Sending a command to the device using sendout DDE command

The following VBA subroutine sends a string of control codes out the serial port by issuing the DDE command “[SendOut()]” to WinWedge. In this example, we’re sending four characters: an ASCII 27 (an ESC character), a capital ‘P’, and a carriage return and line feed characters (ASCII 13 and 10).

Sending a string to the device using send DDE command

The following subroutine shows how to send a text string passed as an argument to the routine.
The following subroutine sends a column of data out the serial port starting in the currently active cell. After each cell’s data is sent it reads the cell directly below the current cell. If the cell contains no data then it stops otherwise it continues sending until it hits an empty cell.
The following subroutine demonstrates how to send the contents of any string variable out the serial port – even strings that contain control characters or non printable ASCII characters. The string to be sent out the serial port is passed as an argument to the SendString subroutine.
The following subroutine demonstrates how you would call the above routine passing it the contents of a spreadsheet cell thus sending the cell contents out the serial port.
The following Excel VBA subroutine demonstrates how to transmit data out the serial port by “DDEPoking” to the WinWedge OutputBuffer DDE item.
Last modified on October 19, 2026