Advertisement

09.04.2008 at 08:33AM PDT, ID: 23703048
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

Excel file is locked for editing, but Excel is not anymore in the processes list!

Asked by cdebel in Programming for ASP.NET, Microsoft Visual Basic.Net

Tags:

I'm developping an application using ASP.NET and VB.NET.  It use Office 2003 Interop's to open a report template of a report file, then after the job is complete, it update the report and place it in a specific folder under the root (/reports).  The file name contain the date & time when the report was generated.  Then, it send this report to the user who generated it.

When the user get it by email, everything is fine.  He can open the excel file without any problem.

On the server, there's some problems.  If i try to open the report it will tell me that the file is locked for editing and giving "read only, notify, cancel" choice.  So it mean that the file is still in use... but i've checked, there's no EXCEL in the Processes list.   (Can't delete the file also of course).

Any idea of what i'm doing wrong?

Anyone have amethod to Save & Close an Excel file, then close Excel properly?

Here's my code:
(Note: I've tried to place several Thread.Sleep, but it just took longer before i've got the email, but the problem is still there)Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
' Save & Close the report, then quit Excel, then release the objects
oExcelApp.ActiveWorkbook.Close(Excel.XlSaveAction.xlSaveChanges)
' Tried Sleep Here - 10 seconds
oExcelApp.Quit()
' Tried sleep Here - 5 seconds
 
System.Runtime.InteropServices.Marshal.ReleaseComObject(oExcelApp)
' Tried sleep Here - 5 seconds
oExcelApp = Nothing
GC.Collect()
[+][-]09.05.2008 at 07:37AM PDT, ID: 22399404

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, Microsoft Visual Basic.Net
Tags: ASP.NET, VB.NET
Sign Up Now!
Solution Provided By: sammy1971
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.08.2008 at 01:24PM PDT, ID: 22421173

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.09.2008 at 09:12PM PDT, ID: 22434914

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628