Kill Process in Navision

lhtirollhtirol Member Posts: 6
Hello,

I have a little problem. When an excel export does not finish successfully I see the Excel process in the taskmgr.
After error correction I start the excel export again (same file). Then I got the error that the file is write-protected.

So I want to kill all excel processes before exporting o Excel.

Any ideas?

Regards
Lukas H.

Comments

  • ProcatProcat Member Posts: 31
    It's not neat, but the following might do the trick.
    SHELL('C:\windows\system32\taskkill.exe', '/IM notepad.exe');
    
    This might give you a "Do you want to save this..." popup, alternative you could use /F instead of /IM.
  • lhtirollhtirol Member Posts: 6
    Thanks for your hint.

    Unfortunately it does not work although taskkill syntax is correct.

    But the solution is simple:
    Run the taskkill via CMD.exe
    SHELL('C:\WINDOWS\system32\cmd.exe', '/c', 'TASKKILL /F /IM EXCEL.EXE /T');
    

    Kind Regards
    Lukas H.
Sign In or Register to comment.