Hi all,

i am using below code, to retain primary tab and closing all other windows or tabs in internet explorer.

But i need to amend this code to suit my requirement,

My requirement is, There are multiple windows of internet explorer i kept open. I dont want my code to close everything.
it should close sub tabs only on specific window. And should not disturb other new windows i kept open.

eg., Window 1 ( i have gmail and with sub tabs )
window 2 ( google and with sub tabs )

Now existing macro would close both window 1 and window 2 , retaining 1st tab in window 1.

what i need is, this macro should be focusing only on gmail window 1 and should not disturb window 2.

Given code for your reference.

HTML Code: