Microsoft KB Archive/120721

{|
 * width="100%"|

XL5: GP Fault Copying, Moving, or Scrolling Visual Basic Module

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 5.0, 5.0c

-

SYMPTOMS
In Microsoft Excel, when you copy or move a Visual Basic module, or when you scroll the module that you moved or copied, you receive a general protection (GP) fault.

CAUSE
This behavior occurs when the module contains multiple Type statements, and a ReDim statement that dimensions an array as one of the user defined types. If you delete one of the Type procedures, and you then copy or move the module (to another workbook, or to another location in the same workbook), you receive a GP fault in module VBA.DLL.

The problem occurs when the ReDim statement is compiled again in the new workbook. The GP fault occurs either immediately after you move or copy the module (if the ReDim statement is contained in the first screen of the module) or when you scroll in the module after moving or copying as soon as the ReDim statement appears on the screen.

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 for Windows NT, version 5.0.

MORE INFORMATION
A user-defined data type is any data type you define using the Type statement. User-defined data types can contain one or more elements of any data type, array, or a previously defined user-defined type.

You can use the ReDim statement to declare dynamic-array variables and allocate or reallocate storage space.