Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error message when you use the "Application.Dialogs(xlDialogChartWizard).Show" code to display the Chart Wizard dialog box in Excel: "Run-time error '1004': Show method of Dialog class failed"


View products that this article applies to.

Symptoms

You run a Microsoft Visual Basic for Applications (VBA) macro in Microsoft Excel that uses the following code to display the Chart Wizard dialog box.
Application.Dialogs(xlDialogChartWizard).Show
				
When you do this, the procedure is unsuccessful. Additionally, you receive the following error message:
Run-time error '1004':
Show method of Dialog class failed

↑ Back to the top


Cause

This problem occurs if the chart on which the code is used is a PivotChart rather than a traditional chart.

↑ Back to the top


Workaround

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. To work around this problem, use the VBA equivalent of the XLM macro command when the chart may be a PivotChart. This command is as follows.
Application.ExecuteExcel4Macro "CHART.WIZARD?(TRUE)"
				

↑ Back to the top


Status

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

↑ Back to the top


Keywords: KB291208, kbpending, kberrmsg, kbdtacode, kbbug

↑ Back to the top

Article Info
Article ID : 291208
Revision : 7
Created on : 1/31/2007
Published on : 1/31/2007
Exists online : False
Views : 326