Share via


XmlMappedRange.Parse Method

Parses a range of data and breaks it into multiple cells

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Syntax

'Declaration
Function Parse ( _
    ParseLine As Object, _
    Destination As Object _
) As Object
Object Parse(
    Object ParseLine,
    Object Destination
)

Parameters

  • ParseLine
    Type: System.Object

    A string that contains left and right brackets to indicate where the cells should be split.

    For example, "[xxx][xxx]" would insert the first three characters into the first column of the destination range, and it would insert the next three characters into the second column.

    If this argument is omitted, Microsoft Office Excel guesses where to split the columns based on the spacing of the top left cell in the range. If you want to use a different range to guess the parse line, use a Range as the ParseLine argument. That range must be one of the cells that is being parsed. The ParseLine argument cannot be longer than 255 characters, including the brackets and spaces.

  • Destination
    Type: System.Object

    A Range that represents the upper-left corner of the destination range for the parsed data. If this argument is omitted, Excel parses in place.

Return Value

Type: System.Object

Examples

The following code example uses the Parse method to parse the value of an XmlMappedRange into three different cells beginning at cell A5. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerAddress1Cell with a corresponding schema element of type int.

Private Sub ParseDate()
    Me.CustomerDateCell.Value2 = "'04042004'" 
    Me.CustomerDateCell.Parse("[XX][XX][XXXX]", Me.Range("A5"))
End Sub
private void ParseDate()
{
    this.CustomerDateCell.Value2 = "'04042004'";
    this.CustomerDateCell.Parse("[XX][XX][XXXX]",
        this.Range["A5"]);
}

.NET Framework Security

See Also

Reference

XmlMappedRange Interface

Microsoft.Office.Tools.Excel Namespace