1) merit:
instead of
ActiveWindow.ActivateNext
ActiveWindow.ActivateNext
you may try (if workboooks are open in one excel instance - but probably they are not):
Worbooks("myworkbookname.xlsx").activate
if in several separate instances (more probable in your case), it will be a bit more complicated.
Nice (but not too simple) solution - see https://stackoverflow.com/questions/...ances-of-excel ) or simpler: https://www.mrexcel.com/forum/excel-...ml#post1074378

2) administrative (also very important):
Please DO read and follow our https://www.excelforum.com/forum-rul...rum-rules.html
This is short set of rules. But in one post you broke two (1st and 3rd). Please edit your post and correct title + use code tags