ExcelApplicationScope seems to be hooking up to opened Excel process if one is available and taking over it.
This leads to leftover Excel processes as well as unexpected file “closures” in Attended/FrontOffice situations. The files are not really closed and changes are preserved, but to a standard user they are inaccessible without knowing specific steps and would most likely lead to losing any unsaved progress due to killing the Excel process via TaskManager.
In addition, if robot takes over existing Excel process from the user, the Visible flag is ignored (or cannot be set) and Excel files will be visible for as long as robot uses that same Excel process, which in a loop might lead the user not being able to use the computer even if all actions should be in the background.
Steps to reproduce:
- Ensure no Excel process is running through TaskManager.
- Manually open an Excel file (file1).
- Run a workflow with ExcelApplicationScope that operates on a different file (file2) with at least 1 write activity (for confirmation of performed operation).
- Observe file1 getting “closed” when ExcelApplicationScope finishes.
- Observe file2 operations (read/write etc.) performed normally.
- Observe that an orphaned Excel process is still running, but is not accessible via normal means for user (alt+tab doesn’t show, no icon on taskbar etc.).
- Observe that file2 handles are properly released (i.e. delete/move/rename the file).
- Observe that file1 is still in use (i.e. delete etc. produce a file in use by another process).
- Observe that trying to manually open file1 produces a NEW Excel process, without actually opening the file (situation same as with point 7, but now 2 orphaned processes).
- Wait for the operating system to clean unused file handles and orphaned processes.
- Observe file2 opening “on its own” (~30 seconds).
- Close file2.
- Observe that no orphaned Excel processes are running.
Robot “takes over” user used Excel process and takes it over, “closing” all opened files when ExcelApplicationScope finishes.
Robot runs ExcelApplicationScope in a new Excel process, unless specifically passed a WorkbookApplication to hook up to.
Last stable behavior: Unknown
Last stable version: Unknown
OS Version: Windows 10 Pro, Server 2016
Others if Relevant: (workflow, logs, .net version, service pack, etc):
Reproduced on Office 2016 and Office 365
Excel package 2.5.0, 2.5.2
Same as with the other issue reported here , the issue could be controlled if there would be a setting to force ExcelApplicationScope to run in a new Excel process instead of hooking up to an existing one.