Thursday, November 10, 2016

Kill the excel


System.Collections.IEnumerable processes;
System.Collections.IEnumerator enumerator;
System.Diagnostics.Process process;
    
try
{
    processes = System.Diagnostics.Process::GetProcessesByName("EXCEL");
    enumerator = processes.GetEnumerator();
    
    while (enumerator.MoveNext())
    {
        process = enumerator.get_Current();
        process.Kill();
    }
}
catch (Exception::CLRError)
{
    throw error(AifUtil::getClrErrorMessage());
}

thanks for Martin. Martin!!! you are the man:)
https://dynamicsuser.net/ax/f/developers/68865/axapta-close-windows-application-process-with-x

0 yorum:

Post a Comment