Specifies the characters to be treated as separators in the string arguments of the SetSeriesValuesFromString, SetCategoriesFromString and SetDataFromTxtFile methods.

object.SetSeparators separators, ignoremultseparators 

Arguments

object
Required. A Chart object.
separators
Required. A string that specifies the characters treated as separators.
ignoremultseparators
Required. A boolean value.
True : consecutive separators are treated as a single separator.
False : two consecutive separators delimit a blank value.

Remarks

By default, SetSeriesValuesFromString, SetCategoriesFromString and SetDataFromTxtFile methods treat the character ";" as the unique separator and two consecutive ";" characters in a string delimit a blank value.

VBScript Sample Code

The following VBScript code illustrates use of the SetSeparators method.

'Let's set the categories of a chart object with a ";"-delimited string
sep= ";"
ignoremultseparators= true

'Before setting the categories, we must specify the separators
chart.SetSeparators sep, ignoremultseparators

myString= "North America" & sep & "South America" & sep & "Europe" & sep & "Middle East" & sep & "Asia"

'Fill the chart with the categories stored in the myString variable
chart.SetCategoriesFromString myString

About multiple separators

You can also specify whether the chart object should ignore multiple separators or not (i.e. the boolean argument ignoremultseparators) while processing the strings or text file passed as arguments of the SetSeriesValuesFromString, SetCategoriesFromString or SetDataFromTxtFile methods. The following example shows how it can affect the way data are stored in the chart object.

'Let's set the categories with ";"-delimited string
sep= ";"

'The myString variable has two consecutive separators
myString= "North America" & sep & sep & "South America" & sep & "Europe" & sep & "Middle East" & sep & "Asia"

  1. Ignoring multiple separators and calling the method SetCategoriesFromString...
    chart.SetSeparators sep, true
    chart.SetCategoriesFromString myString
    

    ...leads the following categories stored in the chart object:

    Categories = North America South America Europe Middle East Asia

  2. However, treating multiple separators as blank values and calling the method SetCategoriesFromString...
    chart.SetSeparators sep, false
    chart.SetCategoriesFromString myString
    

    ...leads to the following categories stored in the chart object (Notice the blank value):

    Categories = North America               South America Europe Middle East Asia

See Also

GetSeparators Method | SetSeriesValuesFromString Method | SetCategoriesFromString Method | SetDataFromTxtFile Method | SetUnicode Method

Applies To: Chart Object