Check if excel process is open and close

Hello everybody,

I need to check if excel is currently open and if true, end it.

I use get processes (output= “currentProcess”) to check all processes and then use an if activity with this condition:
Process.ToString.Contains(“EXCEL”)

Unfortunately, the condition is always false, even if an excel is open. Does anybody know what to do?

Thank you!

You could issue a Kill Process activity with string "excel". This does not fail even if Excel is not already open.

2 Likes

Hello,

I don’t know if its case sensitive but it’s worth checking:

Process.ToString.ToLower.Contains("excel")

For safety, I usually normalize strings before comparison. In VB it would be:

Process.ToString.Normalize.Contains(processName.Normalize)

1 Like

@silvia93
Maybe with the Method from below combined with the comments from above you can do it Safe and Direct

1 Like

hi @silvia93,

Try like this .

image


Mukesh

That’s a good idea, thanks! I just used Kill process for excel without an if activity.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.