Solved

Not closing Excel Application in ASP.NET

Posted on 2002-07-25
5
267 Views
Last Modified: 2008-02-26
Hello Experts,

I am calling Excel Application in ASP.NET to create excel file and charts. It is working fine but it is not closing the opened instance of the Excel Application.

I am using the following code to Save the file and close the application.

AppExcel.DisplayAlerts = False
AppExcel.ActiveWorkbook.SaveAs(strFile)
AppExcel.ActiveWorkbook.Close()
AppExcel.Quit()
AppExcel = Nothing

Then I have added another two lines of code

Response.Cache.SetExpires(Now)
Response.Cache.SetCacheability(HttpCacheability.NoCache)

Now the application is closing some time but not always.

Please help me to solve this problem.

Many thanks in advance.

Siva
0
Comment
Question by:NellaiSiva
  • 2
5 Comments
 
LVL 8

Expert Comment

by:zlatev
ID: 7233712
Try to disable ASP sessions and ASP caching. This can be done from IIS menagement console, properties on Default Web-Site, Home Directory, Configuration, App Options.

HTH
0
 

Accepted Solution

by:
NellaiSiva earned 0 total points
ID: 7237941
Hi zlatev,

I have tried all the options you have mentioned but it is not closing the Excel Application.

So that, I have solved the problem by creating a DLL in VB and using the same in ASP.NET. Now it is working fine.

Thanks for your comments.

Siva
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9421039
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ/Refund

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0
 
LVL 8

Expert Comment

by:zlatev
ID: 9426865
I agree. It seems to be a configuration problem. However the asker did not succed to solve it by method recommended by me. However s/he has mentioned workaround method that solves the issue.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now