| XL5: GP Fault If SQLRequest Results Used in Custom FunctionLast reviewed: September 2, 1997Article ID: Q113847 | 
| The information in this article applies to: 
 
 SUMMARYWhen you use the SQLRequest function in a Microsoft Excel version 5.0 worksheet to generate a numeric result set, and you then create a custom function that uses the range that contains that result set, the hourglass pointer may appear, or you may receive one of the following error messages: 
 Excel caused a General Protection Fault in module EXCEL.EXE at 0025:12FC. -or- Excel caused a General Protection Fault in module OLE2DISP.DLL at 0002:3711. WORKAROUNDIf you use SQLRequest to generate a numeric result set, do not use that range of data in any subsequent macro code. For example, change the following 
    Function AddMeUp(Range)
      AddMeUp = Application.Sum(Range)
   End Function
so that it does not contain references to range. For example, use the
following code instead:
    Function AddMeUp(Arg1, Arg2, Arg3, Arg4)
      AddMeUp = Arg1 + Arg2 + Arg3 + Arg4
   End Function
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel version 7.0 for Windows 95. 
 | 
| KBCategory: kbprg kbtool kberrmsg 
 © 1998 Microsoft Corporation. All rights reserved. Terms of Use. |