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()
...
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement