If the macro is not working, try the following troubleshooting steps:
Double-check the workbook name in the VBA code to ensure it matches the actual workbook name, including the file extension.
Verify that the workbook you want to bring to the front is open.
Enable macros in Excel by going to File > Options > Trust Center > Trust Center Settings > Macro Settings and selecting “Enable all macros”.
Check for conflicting macros and ensure each macro has a unique name and no conflicting instructions.