Article ID: 168650 - Last Review: December 7, 2004 - Revision: 1.2 "Not enough memory" error when you add chart to workbookThis article was previously published under Q168650 On This PageSYMPTOMS
When you attempt to add a new chart to a workbook or access the chart data source, you may receive the following error message:
Not enough memory.
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 or Microsoft Excel 97 Service Release 1 (SR-1).
Note that the problem may occur when you add fewer than 124 charts, 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 have been added in earlier versions of Microsoft Excel, the workbook may contain more than 124 charts. RESOLUTION
To correct this problem when creating new charts, obtain Microsoft Excel 97 Service Release 2 (SR-2) and
perform the following steps.
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base: 322756
(http://support.microsoft.com/kb/322756/
)
How to back up and restore the registry in Windows NOTE: Because there are several versions of Microsoft Windows, the following steps may be different on your computer. If they are, see your product documentation to complete these steps.To resolve the problem, you can add an entry to the registry that disables automatic font scaling for charts. To do this:
If you are unable to obtain Microsoft Excel 97 SR-2, you may be able to work around this limitation by using either of the following methods. Method 1: Turn Off the Auto Scale Option for Fonts in Your Charts
Method 2: Move Charts into Another WorkbookYou may also be able to work around this limitation by moving some of the charts in your workbook into another workbook. Note that charts moved to another workbook remain linked to the data in the original workbook.NOTE: If you remove embedded charts from a worksheet and add additional charts, the "Not enough memory" error message appears unless you first save, close, and then reopen the workbook. If you delete chart sheets or worksheets that contained embedded charts, you can then add new charts up to the limit without receiving the error message and without saving, closing, and then reopening the file. STATUS
Microsoft has confirmed this to be a problem in Microsoft Excel 97 for
Windows. This problem was corrected in Microsoft Office 97 Service Release
2 (SR-2).
For additional information about SR-2, please click the article number below to view the article in the Microsoft Knowledge Base:
Q151261 OFF97: How to Obtain and Install MS Office 97 SR-2
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 check box for that chart is selected (this is the default behavior in Microsoft Excel 97). For example, it is possible to exceed the limit of fonts by creating a workbook that contains the objects in the following table:
Objects Fonts per Object Total fonts used
----------------------------------------------------------------
124 chart objects 2 fonts 248 fonts
1 worksheet 1 font 1 font
used by Microsoft Excel 6 fonts 6 fonts
-----------------
Total 255 fonts
Clearing the Auto scale check box for each chart may allow you to extend the maximum number of charts that can be added to the workbook. | Article Translations
|

Back to the top
