Pega Robotics: Reading multiple sheets from an Excel workbook and populate multiple DataGridView
I am trying to read an excel workbook with multiple sheets and populate the sheet contents dynamically into respective DataGridViews. My problem is three DataGridViews are getting populated with the 2nd Sheet details and the 4th Grid is not getting populated at all. Expectation is each grid should get populated from respective sheets. I have attached the flow and the results screen.
In Excel workbook the second sheet is active. so, when you extracted it took second sheet name. In for loop, you are passing the same name to "_WorksheetProxy1". so, it is going to node condition and datagridview2. that's the reason you are getting same results. one more thing the sheet count is 4. but for loop is executing three times. because the for loop is designed less than than count. in this case less than 4. that is 3. that's why you are not getting fourth grid in result. correct this one also.
Please revert back if you need any further clarifications on this.
Thanks for your response. I corrected the loop counter issue and now the 4 grids are getting populated. But I am not clear about the active sheet. When I introduced break points and msgdialog, for each iteration I am seeing different sheet names and ranges are also correct as per the sheets. Also each datagrid is getting populated according to the sheetname match conditions. I think the issue is with the exportdata method which only takes the activesheet in consideration. can you please let me know how make the other sheets active?