XL97: "Not Enough Memory" Error Adding Chart to Workbook

Last reviewed: January 19, 1998
Article ID: Q168650
The information in this article applies to:
  • Microsoft Excel 97 for Windows

SYMPTOMS

When you attempt to add a new chart to a workbook in Microsoft Excel 97, you may receive the following error message:

   Not enough memory.

If you are using a Visual Basic for Applications macro to add chart sheets to a workbook, you may also receive the following error message:

   Run-time error '1004':
   Method 'Add' of object 'Sheets' failed

CAUSE

This problem may occur if you add more than 124 charts to a workbook when editing the workbook in Microsoft Excel 97.

Note that the limit of charts in the workbook may actually be fewer than 124, especially if you use multiple fonts in worksheets in your workbook or if you use embedded charts. Also, note that if the workbook contains charts that were added in earlier versions of Microsoft Excel, the workbook may contain more than 124 charts.

WORKAROUND

You may be able to work around this limitation by turning off the Auto Scale option for fonts in your charts. To do this:

  1. Select the chart area.

  2. On the Format menu, click Selected Chart Area.

  3. Select the Font tab.

  4. Clear (uncheck) the "Auto scale" checkbox.

  5. Click OK.

You may also be able to work around this limitation by moving some of the charts in your workbook into another workbook. Charts moved to another workbook will remain linked to the data in the original workbook.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

In Microsoft Excel 97, there is a limit of 256 fonts that may be used by the program. When you create a chart, the chart uses two fonts if the Auto Scale feature for that chart is enabled (this is the default behavior in Microsoft Excel 97). So, it is possible to exceed the limit of fonts by creating a workbook that contains the following objects:

   Objects                      Fonts per Object   Total Fonts Used
   ----------------------------------------------------------------
   124 chart objects            2 fonts                   248 fonts
   1 worksheet                  1 font                      1 font
   used by Microsoft Excel 97   6 fonts                     6 fonts
                                                  -----------------
                                                   Total  255 fonts

If you attempt to add a 125th chart to the workbook, the total number of fonts used would be 257. Because this would exceed the limit of 256 fonts, you receive a "Not enough memory" error message.

Turning off the Auto Scale feature for each chart may allow you to extend the maximum number of charts that may be added to the workbook.


Additional query words: 97 XL97
Keywords : xlchart kberrmsg
Version : WINDOWS:97
Platform : WINDOWS
Hardware : x86
Issue type : kbbug
Solution Type : Info_Provided


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: January 19, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.