"Run-time error '-2147467259 (80004005)'" when you programmatically set a property of a chart in Excel

Article translations Article translations
Article ID: 983119 - View products that this article applies to.
Expand all | Collapse all


Consider the following scenario:
  • You have a macro that sets a property of a chart in Microsoft Excel. For example, the macro sets the MaximumScale, MinimumScale, Title, Axis, or Legend property of a chart.
  • You protect the worksheet. When you do this, you click to select the Edit objects check box in the Protect Sheet dialog box.
  • You run the macro.

In this scenario, you receive an error message that resembles one of the following.

Error message 1
Run-time error '-2147467259 (80004005)':

Method 'MaximumScale' of object 'Axis' failed
Error message 2
Run-time error '-2147467259 (80004005)':

Automation error

Unspecified error


This problem occurs because the Excel object model for the chart is disabled on a protected worksheet.


To work around this problem, unprotect the worksheet to enable the macro to run. You can manually unprotect the worksheet or by using the Unprotect method in the macro.


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.


Article ID: 983119 - Last Review: October 31, 2012 - Revision: 3.0
Applies to
  • Microsoft Excel 2013
  • Microsoft Excel 2010
  • Microsoft Office Excel 2007
kbsurveynew kbprb kbexpertiseinter kberrmsg KB983119

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com