473,387 Members | 1,517 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,387 software developers and data experts.

killing excel.exe

Hi All,

I am using Excel.Application object in my code. Now I would like to kill excel.exe created in the task manager.

I am using window API function
Declare Function GetWindowThreadProcessId Lib "user32.dll" _
(ByVal hWnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer


Now I am able to get the process ID of excel.exe when i run this code
in a stand alone page.

When I create a virtual directory and run the page from there,
the process ids returned by this function is zero.

Could anyone pls help.
Aug 28 '08 #1
2 1623
joedeene
583 512MB
are you using the process class ? and a .net language? because you can use process.getprocessesbyid method, or others in the class, and use the .kill() method or a safer method, like .closemainwindow() or .close()?

joedeene
Aug 29 '08 #2
are you using the process class ? and a .net language? because you can use process.getprocessesbyid method, or others in the class, and use the .kill() method or a safer method, like .closemainwindow() or .close()?

joedeene
Hi joedeene,
I am using the process class and the .kill method but in order to identify a
process to kill , I need to know its process id.

I am not able to identify this process id of excel.exe. If I get this process id then I can kill the excel.exe
In order to get this process id I am using
Declare Function GetWindowThreadProcessId Lib "user32.dll" _
(ByVal hWnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer

But when the application is put under a virtual directory and page is being run then process ids being returned by this function are 0.

When page is being run by just right clicking on it and "view in browser", then
process ids are returned.

I am using <identity impersonate="true"/> in my web.config
Aug 29 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Hari Prasad | last post by:
I wrote an application where I am trying to kill a parent frame with out killing the child one. I have created a frame (F1) and if I click a button on F1 I am getting a new frame (F2). Now, if...
6
by: Colin Steadman | last post by:
I have created a function to kill all session variables that aren't in a safe list. This is the function - Sub PurgeSessionVariables For Each Item In Session.Contents Select Case Trim(Item)...
10
by: Jacek Popławski | last post by:
Hello. I am going to write python script which will read python command from socket, run it and return some values back to socket. My problem is, that I need some timeout. I need to say for...
1
by: krose | last post by:
Hi Using a couple of examples on CodeProject.com I've create a nice little shell extension (adds some custom menus for proprietary file types). Everything is working fine, except I can't get it...
0
by: net guest via DotNetMonster.com | last post by:
Hi, i am facing a lot of problems in killing the orphan excel instances. I approached one method like killing the Excel Orphan with processID. I am getting all the Processess that are running...
3
by: kunal.kewalramani | last post by:
I'm opening an Excel file using ASP.NET, but Excel process remains it is not killed, I tried killing it by using Quit() that is also not working, if anybody have any solution for this please help me...
5
by: =?Utf-8?B?QmFyZW4=?= | last post by:
Hi! All, I am using a ASP.NEt application, wherein i am automating Execl object. I am not able to destroy the instance, eve if I write this to destroy the instance of Excel. Please find the ...
0
by: ravindarjobs | last post by:
dear friends, i am using ms access 2003. i wanted to export data from access table to excel table. so i have followed this Dim db As Database Dim ea As Excel.Application Dim rs As...
6
by: Roger Heathcote | last post by:
sjdevnull@yahoo.com wrote: <snip> Fair point, but for sub processes that need to be in close contact with the original app, or very small functions that you'd like 100s or 1000s of it seems...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.