|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problems with Excel Object LibraryI´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. On Wed, 15 Feb 2006 08:28:22 -0600, Sergio Gallardo Contreras <seg***@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)
check point inside "cirkle" (basketball)
Exposing properties of a class within a class Unresponsive UI during lengthy operation ? extending BackgroundWorker ProgressChangedEventArgs Invoking a PictureBox click ? Count lines in multi-line textbox Can't Figure Out Correct Syntax MethodInfo or MethodBase? ThreadPool.QueueUserWorkItem console.write |
|||||||||||||||||||||||