cancel
Showing results for 
Search instead for 
Did you mean: 

Attach to Excel window launched by another program

Anonymous
Not applicable
Hello, I use a program to export data in an Excel file and I want to manipulate these data in Excel before saving the Workbook. After clicking on the "Export" button in the program, an Excel window with a standard and fixed name is automatically opened with all data in a single Worksheet. What I want to do is attach this window to BP so that I can manipulate the data before saving the workbook as a new file. I tried to use the Attach action of the MS Excel object provided with BP, which is basically calling the "Open Instance" action. The problem is that Excel takes a significant time to start and to load the data so the object ends up creating a new instance and doing the manipulation on this new empty Workbook. As a potential solution, I tried to use the "Wait For Process" action of the "Utility - Environment" object. But since Excel takes time to load the data, a new instance is still created. So I added a static timer before the "Open Instance" to force BP to wait longer. In addition to be an ugly fix it is also very unstable. My last stand was to copy the MS Excel object and customize it. In the new object, I used the application manager to identify Excel with the window name and the process name and I specified that the application will already be running. The idea behind this was to take advantage of the fact that the window has a fixed name. So I could take control of the window, save the file and reopen it with the standard object to perform the manipulations. When it came to saving the Workbook, I noticed that the generated file was empty because a new instance was still generated. I'm out of idea and any input would be really appreciated. PS: I use BP v5 on a physical machine running windows 10.   EDIT: The editor of this forum doesn't seem to recognize my returns. A fix for this problem would also be appreciated! 😉
2 REPLIES 2

MelissaSuarez_G
Level 6
Create a new VBO without specifying the window's name, just the process called EXCEL. And create an ""Attach"" action like the attached picture. Note: in the ""Attach"" stage I'm using 0 for the Child Index.

AndreaFrauchige
Level 3
Hi, The MS Excel VBO action ""attach"" seems to be a little unstable, it appears that sometimes a new instance is created as per the action code before the target application has generated the report. When this is the case, Blue Prism is carrying out the subsequent actions in a parallel instance to the one created by the target application. Are there any opinions with regard to this issue? Can it be attributed to wrong timing ie. blue Prism executes ""attach"" too fast?? -> against the latter we have already tested the utility - check window name, but even this does not add stability. thanks a lot in advance, andy