Forums
This topic is locked
Exit Excel [?]
Posted 04 Dec 2003 10:46:11
1
has voted
04 Dec 2003 10:46:11 Doerte Albrecht posted:
Heya,I would like to load a xls-File in .NET, to change it and than to save it again.
All this is no problem. But with each Excel.Application() i create a new process.
There is no way to exit these process after saving. I tried everything <img src=../images/dmxzone/forum/icon_smile_dead.gif border=0 align=middle> like this
theWorkbook.SaveAs(FilePth & FileNm)
excApp.DisplayAlerts = False
excApp.ScreenUpdating = True
theWorkbook.Close(SaveChanges:=False)
excApp.Quit()
excApp.Workbooks.Close()
excApp.Application.Quit()
oSheet = Nothing
theWorkbook = Nothing
oWorkbooks = Nothing
excApp = Nothing
GC.Collect()
And if I try to access to the process with something like this:
Dim pr As Process()
pr = Process.GetProcessesByName("EXCEL"
I always get the errormassage: Access is denied. <img src=../images/dmxzone/forum/icon_smile_question.gif border=0 align=middle>
I get the same massage if I try to close this process by the Taskmanager. <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>
Have I forgot something? Is this a bug? Please, is there somebody who could help me? <img src=../images/dmxzone/forum/icon_smile_dissapprove.gif border=0 align=middle>
Thanks, Doerte