How to avoid opening browser multiple times?

I’m trying to loop through an excel and extract the data from the browser and write back to the excel.
The browser keeps opening every time the count is incremented. How to avoid that? Should foreach activity be used before the process?
Thank you

You should use open browser activity outside for each
use attach browser in for each loop