PRB: Strings w/ TABs Sent from VB to Excel via DDE Are Chopped (82157)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
- Microsoft Visual Basic Standard Edition for Windows 1.0
This article was previously published under Q82157 SYMPTOMS
Unexpected behavior may occur in a dynamic data exchange (DDE) conversation
from Visual Basic to Microsoft Excel when you send a string that contains
TAB characters.
If you specified a specific row and column in the Visual Basic LinkItem
property, the string may be truncated in Excel. If you didn't specify a
column in the LinkItem property but only specified a specific row, the
string will be parsed by Excel, and each TAB will cause the characters
following the TAB to be entered into the following cell in Excel.
CAUSE
The reason for this behavior is that Excel uses TABs as its delimiter. You
can use this method to send multiple items to Excel, placing them in their
own cells if desired.
RESOLUTION
Either don't send strings that contain TABs or else provide more complete
information in the LinkTopic property. For example, in the code shown in
the "Steps to Reproduce Behavior" section below, you can work around the
undesired behavior by placing the following value in the ListTopic
property:
DDEbox.LinkTopic = "R" + Row$ + "C1:R" + Row$ + "C2"
By specifying a larger selection of cells, you can ensure that the data
being passed will not be truncated and that the embedded TAB, RETURN, or
LINEFEED characters will be interpreted correctly as the next column or
next row.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 12/12/2003 |
---|
Keywords: | kbprb KB82157 |
---|
|