Herfried,
Thanks for replying so quickly.
Without getting into too much detail, I'm putting 2 Excel ranges into two
separate 2-dimensional Object arrays, then doing some comparisons and
manupulations. (Afterward, the put the arrays back into Excel. I found this
works MUCH faster than accessing Excel ranges repeatedly.) The code that
seems to initiate the problem is:
If liMRows > 1 AndAlso liDRows > 1 Then
' Arrays are zero-based. By starting with 1, we skip the headers.
For I = 2 To liMRows
For J = 2 To liDRows
If (Not lxDetailArRet(J, liForeignKeyCol) Is Nothing) AndAlso (Not
lxMasterArRet(I, 1) Is Nothing) AndAlso (Not lxMasterArRet(I, liDescrCol) Is
Nothing) Then
lsDetailVal = lxDetailArRet.GetValue(J, liForeignKeyCol).ToString
lsMasterVal = lxMasterArRet.GetValue(I, 1).ToString
lxSubstituteVal = lxMasterArRet.GetValue(I, liDescrCol)
If lsDetailVal = lsMasterVal Then
lxDetailArRet.SetValue(lxSubstituteVal, J, liForeignKeyCol)
End If
End If
Next
Next
End If
(Pasting code into this box is a bear. I apologize for the way it looks...)
When the number of loops is small (e.g., up to 50) I don't see the error.
When, however, large Excel ranges are involved (16,000+ rows) I see the error
repeatedly. Despite this, the routine completes and the data seems get
transferred correctly.
Thanks in advance, Fred de Picciotto
"Herfried K. Wagner [MVP]" wrote:
"Fred" <Fr**@discussions.microsoft.com> schrieb:I receive this message under certain conditions:
1. "Unmanaged Code Debugging" is checked in Property Pages.
2. Certain routines are "stressed." The error does not appear unless
loops
are repeated many times.
I'm using Net Framework 1.1. I found a confirmed bug in Online Technical
Support (Article ID : 811193), but the workaround applies only to C++.
What is the significance of this error? More importantly, can I/should I
do
anything about it?
Can you post some code that causes this error?
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>