Charts Collection Properties and Methods

The Charts collection has a few properties and methods besides the typical collection attributes. These are listed in the following table.

Name

Returns

Description

HPageBreaks

HPageBreaks

Read-only. Returns a collection holding all the horizontal page breaks associated with the Charts collection

Visible

Variant

Set/Get whether the charts in the collection are visible. Also, you can set this to xlVeryHidden to prevent a user from making the charts in the collection visible

VPageBreaks

VPageBreaks

Read-only. Returns a collection holding all the vertical page breaks associated with the Charts collection

Add

Chart

Method. Parameters: [Before], [After], [Count]. Adds a chart to the collection. You can specify where the chart goes by choosing which sheet object will be before the new chart object (Before parameter) or after the new chart (After parameter). The Count parameter decides how many charts are created

Copy

Method. Parameters: [Before], [After]. Adds a new copy of the currently active chart to the position specified at the Before or After parameters

Delete

Method. Deletes all the charts in the collection

Move

Method. Parameters: [Before], [After]. Moves the current chart to the position specified by the parameters

PrintOut

Method. Parameters: [From] , [To] , [Copies] , [Preview], [ActivePrinter],[PrintToFile], [Collate], [PrToFileName]. Prints out the charts in the collection. The printer, number of copies, collation, and whether a print preview is desired can be specified with the parameters. Also, the sheets can be printed to a file using the PrintToFile and PrToFileName parameters. The From and To parameters can be used to specify the range of printed pages

Chart Common Properties

Name

Returns

Description

PrintPreview

Method. Parameters: [EnableChanges]. Displays the current chart in the collection in a print preview mode. Set the EnableChanges parameter to False to disable the Margins and Setup buttons, hence not allowing the viewer to modify the chart's page setup

Select

Method. Parameters: [Replace]. Selects the current chart in the collection

0 0

Post a comment