Closed LordOfRaptor-max closed 3 months ago
related #1560
Going to stay with the workaround.
This basically makes the parameter -KillExcel useless when using the function Export-Excel. Export-Excel are missing the -Force -Confirm:false parameters. Please note that the parameter KillExcel can only kill the process on the current user that execute the script. NOT if you have Excel.exe opened with another user logged in to the server.
Confirm prompts pops up when another user has an Excel process opened and the parameter -KillExcel is used
Example: Confirm Are you sure you want to perform the Stop-Process operation on the following item: EXCEL(25596)? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y")
If you add the parameter -Force in Open-ExcelPackage.ps1 on line 17 you eliminate the prompt issue and all excel process will kill without any interruption.
Get-Process -Name "excel" -ErrorAction Ignore | Stop-Process -Force