By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,887 Members | 1,170 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,887 IT Pros & Developers. It's quick & easy.

Problems with Excel Object Library

P: n/a
Hi,

Im 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
Share this Question
Share on Google+
1 Reply


P: n/a
On Wed, 15 Feb 2006 08:28:22 -0600, Sergio Gallardo Contreras <se****@hotmail.com> wrote:

Hi,

Im 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 discussion thread is closed

Replies have been disabled for this discussion.