Closing a specific numbered tab via macro

I have a macro that clears the contents of specific groups.

To achieve that, it opens tab 17 then clears the groups.

That works fine. What I can’t figure out is how to close tab 17 after that. Is there a way to close tab 17 specifically??

I thought running the macro in background would work, but it didn’t allow the macro to clear the groups without tab 17 in the foreground