TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aurosish Mohanty
NA
13
43.9k
Not able to clear the Excel.exe even after the System.Runtime.InteropServices.Marshal.FinalReleaseComObject(obj) in c#
Feb 22 2011 2:09 AM
Hi all,
I am struggling a lot while trying to close the Excel sheet and any Excel object using the
System.Runtime.InteropServices.
Marshal
.FinalReleaseComObject(obj)
Even though I am using the below code, the EXCEL.EXE is still running in the back , so not able to open and modify the Excel sheet.
Please help me ............. Need your quick response.
private
{
static
void
releaseObject(
object
obj)
try
{
System.Runtime.InteropServices.
obj =
}
{
obj =
}
GC
.Collect();
GC
.WaitForPendingFinalizers();
GC
.Collect();
GC
.WaitForPendingFinalizers();
Marshal
.FinalReleaseComObject(obj);
null
;
catch
(
Exception
ex)
null
;
finally
{
{
System.Runtime.InteropServices.
System.Threading.
}
}
}
if
(obj !=
null
)
Marshal
.FinalReleaseComObject(obj);
Thread
.Sleep(5000);
Reply
Answers (
2
)
MAPI32.DLL
c# web app using Windows Image Acquisition (WIA) in Windows Server 2008