kill a specific excell process

I am using excel from Matlab. I read and write many files from loops. Many excel files remain unclosed and shoot matlab down. I can use the follow syntax to kill all opened excel process: system('taskkill /F /IM EXCEL.EXE').
But during matlab is creating excel files in background, I want to continue to use excel for other issues. This is not possible if I close the excel files all the time in a loop.
Is there a way to kill only a specific excel process (Processes in my loops)?

6 Commenti

Poumbga - why do your many excel files remain unclosed? Why not close a file when you are finished with it before moving on to the next one?
when I call xlsread or xlswrite in a maltab function, matlab start automatically an excel process. How can I close this specefic process before opening the next in a loop?
Hey Poumbga, wondering if you solved this? I am having the excact same problem, i want to close the excelprocess created by the matlab script but no other excel processes. Thanks!
Guillaume
Guillaume il 29 Mar 2018
Modificato: Guillaume il 29 Mar 2018
In recent versions of matlab, matlab uses only one excel process that it keeps alive in order to speed up xlsread and readtable. Force closing it is a bad idea and will not result in any useful gain.
In general, you should not mess with running processes if you do not understand the ramifications behind it.
In older versions of matlab, matlab closed the excel process as the file was closed, so we're back to: why not close the file when you are finished with it instead of again messing with processes.
Dima
Dima il 27 Feb 2019
yes but do you have a workign solution to close the Exel isntanec opened by Matlab??? using matlab 2011
Jan
Jan il 27 Feb 2019
If you use taskkill, the Excel process is killed. This might be really bad if it is writing the output file.

Accedi per commentare.

Risposte (0)

Categorie

Tag

Richiesto:

il 13 Feb 2017

Commentato:

Jan
il 27 Feb 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by