If we need to automate excel activities using excel macros, we must need to enable macros excel
There are two ways to enable excel macros in order to explain please arrange below excel sample macro code in the excel back end macro window. To get below window in excel, please follow below steps
- Open excel
- Click on ALT + F11 (shortcut) then you can see below macro window there you can type any macro or please type below code for testing
- Then find below window
- Save the excel file with any name. While saving keep the Save as type Excel Macro-Enabled Workbook
- Save the file and close
- Open the saved file here in the above case I have saved as Enable macro example. Hence I open the same file as shown in the below
- Now click on Options button in the above to see below screen shot related window
- Click ok.
Note: The above methodology is the best way to enable macros in excel
There is another way also to enable macros in excel. But this is not advisable process. Here I am going to show you in simple way
- Click on file window option as shown in the below screen shot
- Then click on excel options in the above screen to get below screen shot related window
- Click on Trust Center option in the above screen then click on Trust center settings in the same window to get below window
Note : Hope you understood the way you can enable or disable.