Here's a debug screenshot: http://i.imgur.com/HT3mFXy.png?1
The error (Application-defined or object-defined error) occurs at the highlighted breakpoint. This code works for every instance before this, but breaks at i = 34640 and check = 5519.
The cells are both valid, and they're listed in the Watch field. I can't fathom why this is occurring. I'm up late and tired, and hoping I just mistyped something, but I can't figure it out for the life of me.
Here's a quick code snippet producing the same error, under essentially the same conditions:
The error (Application-defined or object-defined error) occurs at the highlighted breakpoint. This code works for every instance before this, but breaks at i = 34640 and check = 5519.
The cells are both valid, and they're listed in the Watch field. I can't fathom why this is occurring. I'm up late and tired, and hoping I just mistyped something, but I can't figure it out for the life of me.
Here's a quick code snippet producing the same error, under essentially the same conditions:
Code:
Sub test()
Dim wkbk As String, checkWkbk As String
Dim check As Long, i As Long
wkbk = "dump1.csv"
checkWkbk = wkbk
i = 34640
check = 5519
Workbooks(wkbk).Sheets(1).Cells(i, 7).Value = Workbooks(checkWkbk).Sheets(1).Cells(check, 6).Value
End Sub