if not db is nothing then set Db =nothing if not Tb is nothing then set Tb =nothing if not Rs is nothing then set Rs =nothing if not TempWordSheet is nothing then set TempWordSheet = nothing if not WworkBooks is nothing then set WworkBooks = nothing if not ExcelAppObject is nothing then set ExcelAppObject = nothing 这样做最保险了,
if not Tb is nothing then set Tb =nothing
if not Rs is nothing then set Rs =nothing
if not TempWordSheet is nothing then set TempWordSheet = nothing
if not WworkBooks is nothing then set WworkBooks = nothing
if not ExcelAppObject is nothing then set ExcelAppObject = nothing
这样做最保险了,
For i = 0 To LstFrom.ListCount - 1
CountIt = 0
BoardName = LstFrom.List(i)
AccessFileName = App.Path & "\Data\Graph2\" & BoardName & ".mdb"
FillInExlcelFromAccessMdb FileName, BoardName, AccessFileName, "Rvalue", "Time"
Dim J As Long
TimerDelay.Interval = 100
While Not TimerDelay.Interval <> 0
J = 0
Wend
Pb1.Value = Pb1.Value + 1
Next i
使用一个循环添加40个ACCESS文件利用上述子程序写入到EXCEL 文件中去的,这种循环导致了这个问题。原来是EXCEL 文件关闭要一定的时间,我原先的程序在,由于循环执行的很快,没有来的急关闭的情况下,就有开了同一个文件,试试看,一个文件被EXCEL 开两次有什么结果呢,?就是这样被卡在那里,造成这种“内存不足的问题”,在写一个DELAY函数之后,一切OK,
同时感谢两位热心人,两个人各加45分。大家高兴。呵呵呵呵后 。