Page 252 - Excel Progamming Weekend Crash Course
P. 252

n540629 ch18.qxd  9/2/03  9:35 AM  Page 227




                  Session 18 — Advanced Charting Techniques                              227

                  The password argument is required only if the chart was password-protected.

                          You learn more about worksheet security and protection in Session 24.

                 Cross-Ref

                          Never lose track of a password used to protect a chart. There’s no way to
                          unprotect the chart without it.
                  Never


               The ChartObject Object

               As mentioned previously in this session, an embedded chart is contained within a
               ChartObject object. The ChartObject controls certain aspects of chart display that are
               independent of the chart itself, such as its position in the worksheet and its size. These
               properties and methods are described in Tables 18-1 and 18-2. An example program using
               some of these properties and methods is presented in Listing 18-1.

               Table 18-1  ChartObject Properties

               Property                Description
               BottomRightCell         Returns a Range object referencing the single worksheet cell
                                       under the lower right corner of the chart. Read-only.
               Chart                   Returns a reference to the contained chart.
               Height                  The height of the chart in points.

               Left                    The position of the left side of the chart with respect to the
                                       left edge of the worksheet; in points.

               Placement               Specifies how the ChartObject is attached to the worksheet
                                       cell under it. Permitted settings are xlMoveAndSize, xlMove,
                                       and xlFreeFloating.

               PrintObject             If True (the default), the chart is printed when the worksheet
                                       is printed. If False, the chart is not printed.

               Top                     The position of the top the chart with respect to the top of the
                                       worksheet; in points.

               TopLeftCell             Returns a Range object referencing the single worksheet cell
                                       under the top left corner of the chart. Read-only.
               Visible                 True/False value specifying if the chart is visible.

               Width                   The width of the chart; in points.
   247   248   249   250   251   252   253   254   255   256   257