Solution 1 – Solve Through the Context Menu
Steps:
- Open Windows File Explorer and move to the folder where you have saved the desired file.
- Right-click on the file and, from the context menu, select Properties.
- Click on the Unblock checkbox from the General tab.
- Press OK.
- You will find that the security warning problem is resolved, and no further security or risk warnings will appear for the file.
Read More: VBA Object Variable or with Block Variable Not Set in Excel
Solution 2 – Activate Macros from the Security Warning Bar
Steps:
- Select Enable Content.
- Excel will enable the Macros.
Read More: [Fixed!] Subscript Out of Range Error in Excel VBA
Solution 3 – Go to Trust Center to Enable Macros
Steps:
- Go to the File tab.
- Go to the Options.
- Select Trust Center and go to Trust Center Settings.
Note: In addition, you can add Trusted Locations and Trusted Documents. As a result, macros will be enabled automatically for those particular locations and documents.
- Enable VBA macros from Macro Settings.
- Excel will activate the macro.
Read More: Reasons And Solutions for Excel Object Required Error in VBA
Solution 4 – Allow Macros from File Info
Steps:
- Go to the File tab.
- Select the Info option and select Enable Content.
- You can also select Advanced Options to enable macros for a single session.
- Check Enable content for this session and press OK.
- The Excel file will enable the macro.
Read More: [Fixed!] Excel Application-Defined or Object-Defined Error in VBA
Download the Practice Workbook
You can download the workbook used for the demonstration from the download link below.
Related Articles
- How to Fix Compile Error in Hidden Module in Excel
- [Fixed!] Invalid Forward Reference in VBA
- [Fixed!] Unable to Set the Visible Property of the Worksheet Class
- [Fixed!] Method Open of Object Workbooks Failed
- [Solved]: User Defined Type Not Defined in Excel VBA
- Sub or Function Not Defined in Excel VBA
- [Solved!] Excel VBA “Argument Not Optional” Error