if i uses invoke power shell to task kill excel.exe will that have implication to other background running excel on other processor?
As in if there are two robot running in the background and one foreground and there is an invoke power shell activity to taskkill /F /IM excel.exe, will this command also execute those that are not under this processes been killed by this command?
Yes, if you use the “Invoke Power Shell” activity to forcefully terminate the Excel process by running the command taskkill /F /IM excel.exe , it will terminate all running instances of Excel on the machine where the PowerShell script is executed. This command is not limited to killing Excel instances associated with a specific process or user; it will terminate all Excel processes matching the specified image name.
Close Workbook: Instead of killing the Excel process, you can try closing the specific workbooks that are causing issues. Use the “Excel Application Scope” activity to open the workbook, perform any necessary operations, and then use the “Close Workbook” activity to close it. This approach may be more controlled and have less impact on other running instances of Excel.
VBA Macro: You can use the “Invoke VBA” activity within an “Excel Application Scope” to execute a VBA macro that closes specific workbooks or performs other cleanup actions. VBA macros can provide more flexibility and control over Excel operations.
PowerShell with Excel COM Object: Instead of using the “taskkill” PowerShell command, you can use PowerShell with the Excel COM object to interact with Excel and close specific workbooks or instances. This approach allows for more targeted control and can be more graceful than forcefully terminating processes.
Check for Open Workbooks: Before attempting to close or kill Excel, you can use PowerShell or VBA to check if the workbooks that need to be closed are already open. If they are open, perform the necessary actions to save and close them gracefully.
Increase Timeout and Retry: If VM synchronization is causing delays, you can increase the timeout in the “Kill Process” activity and add retries to ensure that the activity has enough time to terminate the Excel process.