Right? Then why this error? And after some online research I got the answers and solved the issue. I was confused because the workbook I was using was already Unhidden that is why I was able to open it. Unhide the workbook using the Unhide command.' The error said, 'Cannot edit macros on a hidden workbook.
But surprisingly I was not able to delete some macros. So I opened up the macro list from view and went to delete those macros. So recently I received an Excel file that contained macros which I didn't need.