Solved

Not closing Excel Application in ASP.NET

Posted on 2002-07-25
5
273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VS 2017 18 105
Amazon S3 Images with .Net 3 33
T-SQL and CLR parameter strings 9 28
How to set focus on a dynamic control 18 24
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…

733 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