XL5: GET.FORMULA Doesn't Return Chart Title Text

Last reviewed: September 12, 1996
Article ID: Q120159
The information in this article applies to:
  • Microsoft Excel for Windows, version 5.0

SYMPTOMS

In Microsoft Excel, when you use the GET.FORMULA function in a MS Excel 4.0 macro to return a chart title, no text is returned.

CAUSE

This behavior occurs when you use the GET.FORMULA function with the "title" argument to return a chart title as in the following example:

   =GET.FORMULA("title")

In Microsoft Excel version 4.0, this command returns the title of the active chart. However, when you use this command in Microsoft Excel version 5.0, no text is returned.

WORKAROUND

To return the title of a chart using a macro, do either of the following:

  • Use the following MS Excel 4.0 macro:

          (Note that the following should be entered as one line)
          A1: =RUN("'application.activeworkbook.names.add
    
                   ""charttitle"",Sheets(""Chart1"").ChartTitle.Text'")
          A2: =ALERT(charttitle)
    
       -or-
    
    
  • Use the Text property of the ChartTitle object in a Visual Basic procedure as in the following example:

          MsgBox (Charts("chart1").ChartTitle.Text)
    

Microsoft provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel version 5.0c for Windows.

MORE INFORMATION

You can use the GET.FORMULA function to return the contents of a cell as it would appear in the formula bar. Although it is not documented, when you use the GET.FORMULA function with the "title" argument in Microsoft Excel version 4.0, the title of the active chart is returned.

REFERENCES

For more information about GET.FORMULA, choose the Search button in the Microsoft Excel Macro Functions Help and type:

    GET.FORMULA function


KBCategory: kbprg
KBSubcategory:

Additional reference words: 5.00



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.