导出至Excel遇数组索引越界错误:调整代码仍存疑问求助
Update on Excel Export Error Troubleshooting
Hey folks, just wanted to loop everyone in and send a huge thanks to @Blackwood and @Mary for their guidance so far!
I’m still hitting the error 「Export to Excel: Index outside bounds of array」, but I’m actively digging into the root cause right now.
Changes Made to the Code
Here are the adjustments I’ve implemented based on your suggestions:
- Following Mary’s tip, I reset the
StringSplitOptionsreturn option toNonein both theFor Eachline and theDim _LogParts()line. - Updated the assignment in
xlWorkSheet.Cells(_Row, _DT_HDR) =to use the pre-formatted variable_ANY_DTinstead of_LogParts(3).
Quick Question
One thing I’m confused about: I’m not sure why I need to execute the LogEntry.Split operation twice. If anyone has insights on that, I’d really appreciate the input!
Also, I’ve added the msgbox as recommended by Blackwood to help with debugging checks.
内容的提问来源于stack exchange,提问作者JustAnotherCog
相关产品推荐
相关产品推荐

