Article ID: 171362 - Last Review: November 23, 2006 - Revision: 2.2

XL97: Error Message Calculating Custom Function in Formula Bar

This article was previously published under Q171362
Expand all | Collapse all

SYMPTOMS

When you calculate a formula in the formula bar by pressing F9, you may receive the following error message:
This program has performed an illegal operation and will be shut down.
If the problem persists contact the program vendor.
If you click Details, you receive an error message similar to the following:
EXCEL caused an invalid page fault in module EXCEL.EXE at 0137:301b7f65.

CAUSE

This problem occurs when you do the following:
  • You create a custom function in a workbook and save the workbook as a Microsoft Excel add-in. -and-

  • You enter a formula that uses the user-defined function more than once. -and-

  • You select the cell that contains the formula. -and-

  • You click in the formula bar and press F9.

RESOLUTION

To correct this problem, install Microsoft Excel 97 Service Release 1 (SR-1).

STATUS

Microsoft has confirmed this to be a problem in Microsoft Excel 97. This problem was corrected in Microsoft Excel SR-1.

For additional information about SR-1, please see the following article in the Microsoft Knowledge Base:
172475  (http://support.microsoft.com/kb/172475/EN-US/ ) OFF97: How to Obtain and Install MS Office 97 SR-1

MORE INFORMATION

Microsoft provides programming examples 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 article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals 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 needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:

Microsoft Certified Partners - https://partner.microsoft.com/global/30000104 (https://partner.microsoft.com/global/30000104)

Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice (http://support.microsoft.com/gp/advisoryservice)

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS (http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms) When you create a custom function in Microsoft Excel, you can save a workbook as an add-in by selecting the Microsoft Excel Add-In (*.xla) file type in the Save As dialog box. However, if you install the add-in in the Add-Ins dialog and use your user-defined function in a formula, Excel may close unexpectedly. This problem occurs if the formula refers to the custom function more than once. For example, the following formula causes Excel to fail when you select the formula in the formula bar and press F9 to calculate the formula:
  =MyFunction(1)+MyFunction(2)
				
Note that in this example, the custom function is the following:
   Function MyFunction(x as integer)
       MyFunction = x
   End Function
				

APPLIES TO
  • Microsoft Excel 97 Standard Edition
Keywords: 
kbbug kberrmsg kbfix kbprogramming KB171362
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations