Page 363 - Microsoft Office Excel 2003 Programming Inside Out
P. 363

Part 5: Manipulating Excel Objects
                                                            Charts

                             Table 15-3.  Chart Properties
                             Name              Returns     Description
                             HasTitle          Boolean     Used to set whether the chart will display a chart title.
                             PlotBy            xlRowCol	   Used to set whether columns in the original data are
                                                           used as individual data series (xlColumns) or if the
                                                           rows in the original data are used as the data series
                                                           (xlRows).

                             Table 15-4 lists the commonly used ChartObject property names and their results.

                             Table 15-4.  ChartObject Properties
                             Name             Returns      Description
                             BottomRightCell   Range       Returns the single cell range located under the lower
                                                           right corner of the embedded ChartObject.
                             Chart            Chart        Returns the actual chart associated with the
                                                                                                             Chapter 15
                                                           ChartObject.
                             Height           Double       Sets the height of the embedded chart.
                             Left             Double       Sets the distance from the left edge of the margin to
                                                           the left edge of the ChartObject.
                             Name             String       Sets the name of the ChartObject.
                             PrintObject      Boolean      Sets whether the embedded object will be printed
                                                           when the worksheet is printed.
                             RoundedCorners   Boolean      Sets whether the embedded chart will have rounded
                                                           corners. By default, the property is set to False, which
                                                           displays right-angled corners.
                             Shadow           Boolean      Sets whether a shadow will appear around the
                                                           embedded chart.
                             Top              Double       Sets the distance of the Top edge of the ChartObject
                                                           to the top of the worksheet.
                             Visible          Boolean      Sets whether the ChartObject is visible.
                             Width            Double       Sets the width of the embedded chart.

                             Each object within the chart has a series of properties as well. For example, the ChartTitle
                             object can have a navy blue 2 point border or no border with a shadow. The ChartTitle can be
                             set using the position properties, such as Left and Top. In fact, the orientation can also be set.
                             When it comes to formatting a chart by enhancing the cosmetic appearance, the possibilities
                             are almost endless. Before programming the macro, modify an existing chart and document
                             the changes you have made to the chart. Now based on the sample chart and your documen­
                             tation, add the appropriate lines of code to your procedure.




                                                                                                       337
   358   359   360   361   362   363   364   365   366   367   368