XL5: GP Fault Using PATTERNS Formula with Cell Selected

ID: Q119571

5.00 WINDOWS kbprg

The information in this article applies to:

SYMPTOMS

In Microsoft Excel version 5.0, if you run a MS Excel 4.0 macro that contains the PATTERNS formula, you receive a general protection (GP) fault if a cell on a worksheet or macro sheet is selected.

CAUSE

This behavior only occurs if you use one of the syntax forms of the PATTERNS formula for a chart item, or object, while a cell is selected on a worksheet or macro sheet. The problem occurs because the syntax forms of the PATTERNS formula for a chart item or object contain up to 12 arguments, while the syntax form for a cell contains only 4 arguments. If you use one of the syntax forms of the PATTERNS formula that contain more than 4 arguments, while a cell is selected, you receive a GP fault.

WORKAROUNDS

To avoid receiving a GP fault when you use the PATTERNS formula, do either of the following:

Microsoft provides macro 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 macro is provided as is and Microsoft in no way guaranties that the following code can be used in all situations and will not support modifications of the code to suit specific customer requirements.

   A1: =WORKBOOK.SELECT("Chart1","Chart1")
   A2: =SELECT("Plot")
   A3: =PATTERNS(0,1,8,3,FALSE,0,1,2,2,FALSE,FALSE,FALSE)
   A4: =RETURN()

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 a later version of Microsoft Excel.

In Microsoft Excel version 5.0c, if you use the incorrect syntax form of the PATTERNS formula while a cell is selected, you receive a macro error instead of a GP fault.

REFERENCES

For more information about PATTERNS, choose the Search button in Microsoft Excel Macro Functions Help and type:

    PATTERNS function

KBCategory: kbprg KBSubcategory:

Additional reference words: 5.00 gpf

Version           : 5.00
Platform          : WINDOWS

Last Reviewed: September 14, 1996