CB.CreateChart

This function creates a new chart of the specified type and returns the chart ID of the new chart. Optionally, you can specify the name. If successful, the new chart becomes the selected chart for subsequent chart calls. If the chart is not created successfully, an empty string is returned.

Table 28. CB.CreateChart Returned Data Type

Returned Value

Returned Data Type

The path and name of the new chart of the specified type, ChartID, in the format:

"|Current Results|Sensitivity Charts|Charts.xls|Sensitivity Chart 1"

String

Table 29. CB.CreateChart Parameters and Constants

Parameter

VBA Data Type

Value

Description

SimChartType

Integer

cbChtOverlay = 1, cbChtScatter = 2, cbChtSensitiv = 3, cbChtTrend = 4

Specifies the type of chart you are creating: overlay, scatter, sensitivity, or trend chart. For named constant and index values, see the Value column.

DisplayName (Optional)

String

"Chart ID"

User-defined or default chart name (title) entered directly