BUG: Error 10 Attempting to ReDim or Erase an Array
Article ID: 187553
Article Last Modified on 5/13/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 6.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
This article was previously published under Q187553
SYMPTOMS
When using arrays of user-defined types (UDTs) with a With statement inside
a For loop, Visual Basic will not unlock the array when exiting the loop
with an Exit For statement. If you attempt to re-dim or erase the array,
the following run-time error is received:
Run-time error 10
This array is fixed or temporarily locked
RESOLUTION
Avoid using Exit For inside a With statement. A GoTo statement should be
used instead.
NOTE: Be sure that the End With statement is executed. If the statement is not executed, you will receive the above error message.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products
listed at the beginning of this article. We are researching this
bug and will post new information here in the Microsoft Knowledge
Base as it becomes available.
REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
176049
: BUG: Run-time Error "This Array is Fixed or Temporarily Locked"
Additional query words: kbDSupport kbdss kbVBp500bug kbNoKeyWord kbVBp600bug
Keywords: kbbug kbnofix KB187553