473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Problems with Excel Object Library

Hi,

I´m using Microsoft Excel 11.0 Object Library in an ASP.NET web
application to generate a XLS file. It works fine but sometimes the
EXCEL.EXE process remains in the computer, and when I try to kill it,
the message "Access denied." is showed. I try to kill the process with
the System.Diagnostics methods, obtainin the process ID and then killing
it, It works too, but sometimes when the method Process.GetProcess is
called, the exception "Access denied." is raised. This is some of the code

Dim oXL As New Excel.Application

Dim aProcesses() As Process = Process.GetProcesses

For i = 0 To aProcesses.GetUpperBound(0)
If aProcesses(i).MainWindowHandle.ToString = oXL.Hwnd.ToString Then
intExcelPID = aProcesses(i).Id
Exit For
End If
Next
Can someone help me, thanks.
Feb 15 '06 #1
1 1298
On Wed, 15 Feb 2006 08:28:22 -0600, Sergio Gallardo Contreras <se****@hotmail.com> wrote:

¤ Hi,
¤
¤ I´m using Microsoft Excel 11.0 Object Library in an ASP.NET web
¤ application to generate a XLS file. It works fine but sometimes the
¤ EXCEL.EXE process remains in the computer, and when I try to kill it,
¤ the message "Access denied." is showed. I try to kill the process with
¤ the System.Diagnostics methods, obtainin the process ID and then killing
¤ it, It works too, but sometimes when the method Process.GetProcess is
¤ called, the exception "Access denied." is raised. This is some of the code
¤
¤ Dim oXL As New Excel.Application
¤
¤ Dim aProcesses() As Process = Process.GetProcesses
¤
¤ For i = 0 To aProcesses.GetUpperBound(0)
¤ If aProcesses(i).MainWindowHandle.ToString = oXL.Hwnd.ToString Then
¤ intExcelPID = aProcesses(i).Id
¤ Exit For
¤ End If
¤ Next
¤
¤
¤ Can someone help me, thanks.

See if the following helps:

Office application does not quit after automation from Visual Studio .NET client
http://support.microsoft.com/?kbid=317109
Paul
~~~~
Microsoft MVP (Visual Basic)
Feb 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
17
by: Ange T | last post by:
Hi there, I'm having pain with the VB behind an Access form. The form is used to create reports in Excel based on the details entered in the form. This has always worked without error on my...
2
by: Alvin Bruney | last post by:
anybody know how to launch desktop excel from a webpage and feed it either a dataset or a file? i've got MS sample code but it aint compiling with the office 10 library. i wonder if they changed...
18
by: Frank M. Walter | last post by:
Hello, I have made an small AddIn with udf for excel 2003. I use vs2003. The point of view is the function __T() I call it in excel sheet writing =__T() I am not able to set a value to a...
2
by: James | last post by:
I am doing some Excel 2000 automaton using Vb 2005. I am referencing the Excel 9.0 COM Object Library. The following code was working fine: Dim xlApp as new Excel.Application Dim xlWb as...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.