Convert Process object to Window, Browser or Workbook object

Hi Everyone,

Do you have any idea of how to convert object of type System.Diagnostics.Process to an object of type UiPath.Core.Window or any UiPath container object?

System.Diagnostics.Process object already contains Handle property of type IntPtr so, I think there must be a way of converting this IntPtr to UiPath.Core.Window. Did anyone ever deal with such a requirement.

The main reason for that is; sometimes we require to open excel with Process.Start method. In that case we already have the process object but I couldn’t find a proper way of converting Process object to Window object. It is required because we could have multiple excel files opened meanwhile and we cannot run kill process before starting excel.

I know we can continue with while block and dynamic selector to find the correct excel workbook after Process.Start method and attach on it but I think there should be a way of converting Process.Handle to Window object or Workbook object.

Thanks.

3 Likes