MXL5: Run-Time Error '1004' or '1006' Using ATP Function

Last reviewed: February 2, 1998
Article ID: Q125804

The information in this article applies to:
  • Microsoft Excel for the Macintosh, versions 5.0, 5.0a

SYMPTOMS

In Microsoft Excel, when you use one of the Analysis ToolPak worksheet functions, you may receive one of the following error messages:

   Run-time error '1004':
   Run Method of Application class failed

   -or-

   Run-time error '1006':
   Unable to get the ThisWorkbook property of the Application class

CAUSE

These symptoms occur if the workbook that contains the function also contains a module sheet that references the Analysis ToolPak-Visual Basic for Applications add-in file.

The error messages occur when you use one of the following worksheet functions:

   EDATE()
   EOMONTH()
   IMSUM()
   NOMINAL()
   TBILLEQ()
   TBILLPRICE()
   TBILLYIELD()
   GCD()
   LCM()
   MULTINOMIAL()
   IMPRODUCT()
   CUMIPMT()
   CUMPRINC()
   BESSELI()
   BESSELJ()
   BESSELK()
   BESSELY()

You receive the run-time error '1004' if the Analysis ToolPak-Visual Basic for Applications add-in is also loaded (selected in the Add-ins dialog box). If the Analysis ToolPak-Visual Basic for Applications is not loaded, you receive the run-time error '1006.'

Note that this behavior also occurs if you use the FunctionWizard to insert the function.

WORKAROUND

To avoid receiving these error messages when you use one of the Analysis ToolPak worksheet functions, use either of the following methods:

Method 1

Move the Visual Basic module that references the Analysis ToolPak-Visual Basic for Applications file to another workbook that does not contain a worksheet that uses an Analysis ToolPak worksheet function.

Method 2

Clear the Analysis ToolPak check box in the Add-Ins dialog box and restart Microsoft Excel. To do this, use the following steps:

  1. On the Tools menu, click Add-Ins, and clear the Analysis ToolPak check box.

  2. Verify that the Analysis ToolPak--VBA check box is selected, and click OK.

  3. Save your work if necessary, click Quit on the File menu, and restart Microsoft Excel.

NOTE: In order to successfully use the Analysis ToolPak function in the worksheet, you must also click the module sheet,click References on the Tools menu, select Analysis ToolPak--VBA and click OK.

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: 5.00 addins atp err msg toolpack
Keywords : xlmac kbtool
Version : MACINTOSH: 5.0, 5.0a
Platform : MACINTOSH
Issue type : kbbug
Solution Type : kbworkaround


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