D
D
DrSterN2021-05-14 08:12:33
excel
DrSterN, 2021-05-14 08:12:33

Excel process freezes, how to end after a certain time?

There is a problem with Excel.
Server 1C and SQL on the same machine.
When working with databases, users upload and download documents, at this moment an excel process is launched on the 1C server to process files. But it happens that this process freezes and blocks the work of further unloading excel files. In general, in 1C, all functions related to excel that pass through this server stop working.
How can I automatically kill an excel process that has been running for more than 5 minutes?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-05-14
@rPman

A very strange decision to do data processing in excel.
The correct decision is to figure out why it hangs, is your code? insert logging there, in the same place the output is made forced by checking the time.
If it doesn’t work / there is no access from inside the code, then with an external script, kill the process with the regular windows taskkill utility, there you can kill the process by the file name of the .exe process, or for example by the title. Script example:

ping -n 300 localhost
IF NOT EXIST result.xls taskkill /im excel.exe

This script waits 300 seconds (pings localhost)
and then checks for the presence of the result.xls file and if it doesn't exist, kills all excel.exe processes
read the doc to taskkill to pick up the right condition if other desired excel processes can be running on the server, for example by restricting user windows /FI "USERNAME eq User"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question