Your macro must not be specifying which workbook to operate on, so Excel is defaulting to using the ActiveWorkbook.
If you paste the code of your BeforeClose macro changes can be adjusted to make sure it runs where it is supposed to
If you are happy to edit the code yourself you need to make sure everything is reference to 'ThisWorkbook'.