12.1 Developer Tab, Macro Security and .xlsm
Steps in Excel
- Show the Developer tab: File › Options › Customize Ribbon › in the right list tick Developer › OK. Groups: Code (Visual Basic, Macros, Record Macro, Use Relative References, Macro Security), Add-ins, Controls, XML.
- Macro security: Developer › Code › Macro Security (or File › Options › Trust Center › Trust Center Settings… › Macro Settings). Options:
- Disable VBA macros without notification
- Disable VBA macros with notification – recommended/default: a yellow bar offers Enable Content for files you trust
- Disable VBA macros except digitally signed macros
- Enable VBA macros – not recommended
- Trusted Locations (same dialog): add a folder such as
D:\ExcelMacros\– files there open with macros enabled. - Save with macros: File › Save As › Save as type: Excel Macro-Enabled Workbook (*.xlsm). Saving as
.xlsxdeletes the code (Excel warns you). - A downloaded
.xlsmshows a red Security Risk bar: if you trust it, close it, right-click the file in File Explorer › Properties › tick Unblock › OK.
| Format | Macros? | Use |
|---|---|---|
.xlsx |
No | Normal workbooks |
.xlsm |
Yes | Workbooks with macros |
.xlsb |
Yes | Binary – smaller/faster for very large files |
.xlam |
Yes | Add-ins (functions available in all workbooks) |
Ravindra Bagale's Tip
Writing a macro and saving it as .xlsx is the most painful mistake many students make, because if you click "Yes" on Excel's warning, all the code is gone! Save the file as .xlsm from your very first macro. And don't set security to "Enable all macros" – Disable with notification is the safe option.
Ravindra Bagale's Tip – मराठी
Macro लिहून .xlsx मध्ये save करणं – ही बऱ्याच students ची सगळ्यात दुःखद चूक आहे, कारण Excel च्या warning ला "Yes" दाबलं की पूर्ण code गायब! पहिल्या macro पासूनच file .xlsm मध्ये save करा. आणि security "Enable all macros" वर ठेवू नका – Disable with notification च सुरक्षित आहे.
Ravindra Bagale's Tip – हिंदी
Macro लिखकर .xlsx में save करना – यह बहुत से students की सबसे दुखद गलती है, क्योंकि Excel की warning पर "Yes" दबाते ही पूरा code गायब! पहले macro से ही file को .xlsm में save करो. और security को "Enable all macros" पर मत रखो – Disable with notification ही सुरक्षित है.
Practice task
Turn on the Developer tab, set a Trusted Location for your practice folder, and save a copy of Blinkit_Maharashtra as Blinkit_Macros.xlsm.