Hello Rathi R! I'm Gunasekar and I'd be happy to help you with your question.
I understand that you're facing issues with unblocking macros and running VBA code in Excel, despite enabling macros. Here are some steps you can try to troubleshoot the issue:
A. Check Macro Security Settings:
- Open Microsoft word or Excel.
- Select the file and click Options
- Select Trust Center.
- Click Trust Center Settings and
- Select Trusted Locations.
- Select Add a new location.
- Add the domain.
- Make sure you check "Subfolders of this location are also trusted"
- Click OK to save.
Restart the Office apps and run the Macros.
B. Ensure the file is unblocked. To do that,
- Right-click on the Excel file and select Properties.
- In the General tab, check the "Unblock" box if it's available.
Note: These methods are only effective when the Organization has not Blocked Macros via Group Policy. And in this case, I assume that your IT Admin configured Disabling Macros via Group Policy settings.
Enable or disable macros in Microsoft 365 files (Related article for your reference)
https://support.microsoft.com/help/12b036fd-d140-4e74-b45e-16fed1a7e5c6
I hope this information helps. If you have any questions, please let me know and I will be happy to help you further.
Best regards,
Gunasekar N