Microsoft KB Archive/120159

{|
 * width="100%"|

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

 * }

-

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)   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.