1. Modify macro security settings In the Trust Center, click Macro settings. To permanently enable macros, select the Enable all macros option (not recommended, as it can allow potentially dangerous code to run). Also, check Trust access to the VBA project object model if your macro uses VBA code. 2. Add your folder to trusted locations To avoid the warning every time you open the file, place your Excel file in a folder you define as a "trusted location." In the Trust Center, go to Trusted locations, and then click Add a new location. Choose the folder where your macro file is located and check Subfolders in this location are also trusted. 3. Use a macro-enabled Excel file (.xlsm) Make sure your file is saved in .xlsm format, which is designed to contain macros. If you use an .xlsx file, macros will not be preserved. To save in the correct format, go to File > Save As, then choose Excel Workbook that supports macros (.xlsm).
No comments yet