Hi Yasserabdel,
Welcome to the Answers community.
From your post, we understand you are getting the error when you open VBA editor. To troubleshoot this issue, please try clearing caches of Office apps, see if it works.
1. Quit all Office apps on your mac.
2. Open Finder, press Command + Shift + G
3. Enter "~/Library/Containers"
4. Press Command + Shift + G. Find the "com.Microsoft.Excel". If you upgraded your OS to Big sur, look for Microsoft Excel.
5. Move those folders to the desktop.
6. Restart the Mac to see the result.
Besides, please ensure your Office apps are fully updated. The latest version of Microsoft 365/ 2019 for mac is 16.44 (20121301).
To check version, open any Office app such as Word, go to the Excel menu and choose About Excel.
If the version appears lower, then manually update Office apps, click Help > Check for Updates from any of the Office app to get the latest build.
Let me know the status. Have a nice day and stay safe 😊
Regards,
Neha