Knowledge Base

GP Fault If SQLRequest Results Used in Custom Function

Article ID: 113847

Article Last Modified on 10/11/2006


APPLIES TO


This article was previously published under Q113847

SUMMARY

When 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.

WORKAROUND

If 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
				

STATUS

Microsoft 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.

Additional query words: SQL Request SQLREQUEST GP GPF MSQUERY hang crash XL5

Keywords: kbprogramming KB113847