A macro-enabled workbook has the .xlsm extension. An .xlsx file cannot contain VBA code: if you save a workbook containing macros as .xlsx, the code is lost. .xlsm workbooks are subject to the macro security settings.
Example
File > Save As > Excel Macro-Enabled Workbook (*.xlsm).