Excel’s DDERequest() function has two limitations that affect WinWedge users working with complex devices:
DDERequest() always returns a Variant Array, not a string. String functions can’t be applied directly to a Variant Array — you must first assign element 1 to a string variable.
DDERequest() can only return strings shorter than 255 bytes unless the data is tab-delimited. Longer strings are silently truncated.
Workaround overview
Instead of relying on WinWedge’s built-in field parsing, you let the data pass through as a few large chunks and parse it yourself in VBA. The approach:
- Set the “End of Record Event” in WinWedge to “Carriage Return or CrLf Received”
- Set the Record Structure to “Multiple Fixed Length Data Fields”
- Define several 250-byte fields — enough to cover the largest possible record from your device (e.g., a 1125-byte record needs five 250-byte fields)
- Set WinWedge to DDE Server mode
- After the last defined field, enter
[RUN("NewGetSWData")] as the “Field Postamble DDE Command”
Do not apply any filters to the defined fields.
This causes Excel to run the NewGetSWData subroutine after each complete data record is received.
Excel VBA code
The subroutine below pulls all the chunks from WinWedge, reassembles them into a single string, parses the comma-delimited fields, and writes each field to a separate row in the spreadsheet.
Last modified on October 19, 2026