为什么这个程序总是提示“下标越界”?
程序运行时会自动建一个txt文件,以当前【年_月.txt】为名,加了一个日期判断,每月26号为分割,如2019年12月26日就会建一个2020_01.txt的文件并加载用了一个快速加载txt的代码 (此贴 https://bbs.),出错的问题就是这个代码中的一句
发现,日期为2019.12.25或之前就正常,到12.26就提示“下标越界”,但不明白问题出在哪,请哪位大侠帮我修改下问题,十万分的感谢!

Function GetFile(FileName As String) As String '用来秒加载文本文件的 Dim i6 As Integer, s6 As String, BB() As Byte If Dir(FileName) = "" Then Exit Function i6 = FreeFile Dim FileLength '// 打开文件 Open FileName For Input As #19 '// 取得文件长度 FileLength = LOF(19) '// 如果长度为 0,那么就是空的咯 If FileLength <> 0 Then '// 空的 Close #19 ReDim BB(FileLen(FileName) - 1) Open FileName For Binary As #i6 Get #i6, , BB Close #i s6 = StrConv(BB, vbUnicode) GetFile = s6 '调用举例(按钮等执行): 'Dim s6 As String 's6 = GetFile("d:\1.txt") 'Text1 = s End If End Function