You have at nearly the top: On Error GoTo CommDiaCancelled
but CommDiaCancelled: is a label in middle of a For loop.
Perhaps an error happens somewhere before the line: strArr = Split(Input(LOF(1), 1), vbCrLf)
and the error handler jumps directly into the middle of the loop.
At that point, intLB took the default value of 0 (the line "For intLB = 0 to ... " was not executed) and of course strArr(0) gives you subscript out of range because strArr() was not initialized.
Why do you set the error handler jumps directly into the middle of the For Loop ? I don't know the reason.
Perhaps the whole code block
was copied and pasted to a wrong place.Code:CommDiaCancelled: If Err.Number = 32755 Then MsgBox "Cancel selected !" Exit Sub End If




Reply With Quote