cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple instances of Excel opened after loading the queue

BenAnderson
Level 5
Hi,  I have a process that adds 19 items to a queue to be worked. After adding the items to the queue, the process "Gets Next Item" from the queue and the data for that item is put into a collection. This collection has one row with all of the relevant bits of data for that particular queue item in different columns.  The next stage of the process is to open an excel workbook. However, when it goes to open the workbook, it opens 19 instances of the same workbook, one straight after the other.  This is presumably linked to the number of items in the queue in some way. Though, surely it should only open one workbook for that particular queue item (the file path to the workbook is in the collection containing the one row of queue data above). What could the reason be for this error? Any help would be greatly appreciated.   Thank you,  Kind regards,    Ben
Benjamin Anderson, Senior Consultant, UK
12 REPLIES 12

david.l.morris
Level 14
Hi Ben, Can you show some screenshots of your process flow or something? We'll be straight up guessing to give any suggestions. But, while I'm at it... did you verify that the logic that opens Excel is not inside of a loop that happens 19 times? The way you describe it, it sounds like it is supposed to open 19 workbooks if you have it getting an item from the queue, opening the workbook, and then moving to the next item. Again, it's hard to give suggestions without seeing it, but I'm guessing you may just need a couple extra stages that first attempt to look for an open/existing workbook to use and only open the workbook in a new instance if it is not already open. Respectfully, Dave
Dave Morris 3Ci at Southern Company Atlanta, GA

BenAnderson
Level 5
Hi Dave,    Many thanks for your reply. Please see attached for a few screenshots. The ""Open Workbook"" action is not in a loop, no, and is from the normal Blue Prism MS Excel VBO. The issue seems to be linked to the queue somehow - for example I noticed that whenever the process failed after opening Excel 19 times, it marked the queue item as an exception - however it also marked all 19 queue items as an exception, even though it only retrieved one item from the queue, and that item was locked for working (please see the screenshots).  Screenshots: #1 This is an image of immediately after the items were added to the queue, using the ""Add to Queue"" action. Then the bot used the ""Get Next Item"" to retrieve the next item from the queue and mark it as ""Locked"" with a padlock.  # 2 After using the ""Get Next Item"" the output was put into two data items (the Item ID, and a collection with all the data for that item - note it has only one row for that item) #3 The process flow where the error occurs.  #4 The inputs for the ""Open Workbook"" action. The file path is just a normal shared drive location, and works fine in other processes. #5 The code stage in the Object Studio for the ""Open Workbook"" action.   Many thanks in advance for any help, Kind regards,  Ben  
Benjamin Anderson, Senior Consultant, UK

BenAnderson
Level 5
Image #2
Benjamin Anderson, Senior Consultant, UK

BenAnderson
Level 5
Image #3
Benjamin Anderson, Senior Consultant, UK

BenAnderson
Level 5
Image #4
Benjamin Anderson, Senior Consultant, UK

BenAnderson
Level 5
Image #5 (Apologies, I couldn't figure out how to upload multiple images to one post. Thank you).
Benjamin Anderson, Senior Consultant, UK

david.l.morris
Level 14
Hi Ben To make sure I'm on the same page with you, you're saying that it is locking a single queue item (1/19), opening 19 instances of Excel, failing, and then marking all 19 queue items without actually calling 'Open Workbook' 19 times, but instead only calling that action once? Just in case it helps me understand: Where is the data coming from that loads the queue? Does it come from within that Workbook by another Process? And what I'm understanding is that your process flow is like this: 0. Something loads the queue with 19 items and puts data in it (perhaps the location of the Excel workbook). 1. Get Next Item from that queue, locking 1 of the 19 items. 2. Create Instance 3. Show Instance 4. Open Workbook using a file path inside the queue item, creating 19 instances of Excel 5. Apply Slicer The thing is that it is not possible for pending queue items to be marked as an exception unless they are locked first. That tells me that somehow your process must be locking the other queue items. As for the 19 instances of Excel, have you tried stepping through the Process in Process Studio and you're saying that when you step over the 'Open Workbook' action that it creates 19 instances?   Respectfully, Dave
Dave Morris 3Ci at Southern Company Atlanta, GA

BenAnderson
Level 5
Hi Dave,  ""To make sure I'm on the same page with you, you're saying that it is locking a single queue item (1/19), opening 19 instances of Excel, failing, and then marking all 19 queue items without actually calling 'Open Workbook' 19 times, but instead only calling that action once?"" Yes, this is correct. The data that is loaded into the queue, comes from a collection which is two collections merged together earlier in the process, called ""MergedAll"" (please see attached screenshot). The queue data doesn't come from the workbook that is opened 19 times, no.    In terms of your summary of the process flow, yes that would be accurate. The file path for the workbook comes from the queue data which is output to a collection when it retrieves the next item, called ""DataCollection"". It is one row in this queue collection.   Yes, I agree on the pending items not being able to be marked as complete/exception, which is what is really stumping me, and makes me think that somehow the process is as you say, locking the other items in the queue.    Yes, we have tried troubleshooting by stepping through the process, and initially thought it was some recursion in the code stage, but to no avail.    I appreciate it is a bit of a strange error to encounter, but it is obviously somehow linked to the queue items.   Many thanks for your reply, Kind regards, Ben
Benjamin Anderson, Senior Consultant, UK

BenAnderson
Level 5
After adding to the queue, the process, gets the next item, as per the screenshot.  Many thanks, Ben
Benjamin Anderson, Senior Consultant, UK