You need to change "yourworkbookname.xlsm" with the name of your workbook. This will check the active workbook name. If it is not the one that the code is intended for it will not fire off. And it won't try to open the workbook again.