Trying to use Excel on a web server is one of the very last thing I would ever try. If you can use a programming Library such as Open XML SDK or some other Library that deals with this file format.
If for now you tried only on your own machine, keep in mind that once deployed on a real web server it will run server side ie you won't be able to control a client side Excel instance this way if this is what you are trying to do.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
What happens is the users who are uploading, downloading the file, when they open those excel files in their client machines, i don't know why it creates those process in the server. If I don't kill that process, the end users face problems while opening
the files again.
What happens is the users who are uploading, downloading the file, when they open those excel files in their client machines
I supposed that an error will be raise
You could take a try.
Best Regards
Cathy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
68 Points
222 Posts
Checking the file status
Oct 17, 2017 10:57 AM|maverick786us|LINK
I am using this program to kill Excel process. Before killing i want to find out, for how long is the file open. How can i accomplish this?
All-Star
48570 Points
18082 Posts
Re: Checking the file status
Oct 17, 2017 01:25 PM|PatriceSc|LINK
Hi,
If you look at the documentation for the Process class, you'll see you could try https://msdn.microsoft.com/en-us/library/system.diagnostics.process.starttime(v=vs.110).aspx
Trying to use Excel on a web server is one of the very last thing I would ever try. If you can use a programming Library such as Open XML SDK or some other Library that deals with this file format.
If for now you tried only on your own machine, keep in mind that once deployed on a real web server it will run server side ie you won't be able to control a client side Excel instance this way if this is what you are trying to do.
Star
8670 Points
2882 Posts
Re: Checking the file status
Oct 18, 2017 06:39 AM|Cathy Zou|LINK
Hi maverick786us,
For you problem, you could get StartTime for each process.
Then you could get difference between the StartTime and current time:
Related links:
https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/8ysw4sby(v=vs.110).aspx
Best Regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
68 Points
222 Posts
Re: Checking the file status
Oct 27, 2017 09:11 AM|maverick786us|LINK
What happens is the users who are uploading, downloading the file, when they open those excel files in their client machines, i don't know why it creates those process in the server. If I don't kill that process, the end users face problems while opening the files again.
Star
8670 Points
2882 Posts
Re: Checking the file status
Oct 27, 2017 09:49 AM|Cathy Zou|LINK
Hi maverick786us,
I supposed that an error will be raise
You could take a try.
Best Regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
All-Star
48570 Points
18082 Posts
Re: Checking the file status
Oct 27, 2017 02:31 PM|PatriceSc|LINK
It's really unclear. So far your only worked on your own machine ?
Your code will search an Excel process on the web server side and will have absolutely no effect at all on client side Excel instances.