I believe, the problem is related to the osheet object and because you set it as public variable. You need to release it before closing a workbook (osheet=.NULL., release osheet), or do not define it as public.
Actually I cannot see the reason in your code to use osheet and obook as separate variables or objects. Use WITH statement instead. Anyway it will speed up the performance.
with oexcel.activesheet
mprogram1=.cells(mrow,mcol).value
......
endwith
....
ObjExcel.ActiveWorkbook.Close()
...
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only