Microsoft KB Archive/134264

= Visual Basic Command to Show Set Background Dialog Fails =

Article ID: 134264

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 95 Standard Edition

-



This article was previously published under Q134264



SYMPTOMS
In Microsoft Excel version 7.0, when you attempt to show the Set Background Picture Dialog box in a Visual Basic, Applications Edition, macro, you will receive the following error message:

Run-time error '1004'

Dialog method of Application class failed



CAUSE
This problem occurs because of the following line of code: Application.Dialogs(xlDialogSetBackground).Show



WORKAROUND
To work around this problem, use the ExecuteExcel4Macro method as in the following example: Application.ExecuteExcel4Macro(Sheets.BackGround') 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. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional query words: XL7

Keywords: kbprogramming KB134264

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.