Microsoft KB Archive/93490

{| = Excel: GP Fault with Database Functions =
 * width="100%"|

Last reviewed: April 17, 1996

Article ID: Q93490 The information in this article applies to:
 * Microsoft Excel for Windows, versions 2.x, 3.0, 4.0, 4.0a

SYMPTOMS
If you are using Microsoft Excel for Windows and you use a database function such as DCOUNT, DSUM, or DAVERAGE as the reference in a defined name, if the variable in this function is referenced later on in another sheet, you receive a general protection (GP) fault under Microsoft Windows 3.1 or an Unrecoverable Application Error (UAE) in Microsoft Windows versions 3.0 and 3.0a.

This error also occurs when a database function is referenced on a macro sheet using SET.NAME to define a new variable.

STATUS
Microsoft has confirmed this to be a problem in the versions of Microsoft Excel listed above. We are researching this problem, and will post more information here in the Microsoft Knowledge Base as it becomes available.

WORKAROUND
To avoid receiving a GP fault, create the defined name on the destination spreadsheet. For example, in the Refers To box in the Define Name dialog box you would use the following syntax

=DSUM(Sheetname!Database,Field,Sheetname!Criteria) where Sheetname is the name of the sheet containing the defined name of Database and Criteria. If you receive the error message when you run a macro, you can define the variable name in the macro sheet to avoid the error message by using the following syntax:

=SET.NAME(&quot;VariableName&quot;,DSUM(!Database,Field,!Criteria)) This statement defines &quot;Variable Name&quot; using the defined names of Database and Criteria on the active sheet.