10

I know, the topic sounds very strange, but yesterday I worked on an excel file with VBA all the day long. After saving the file to disk I went home and todays morning the makros are lost?!

Please give me some hints, where I can search after the makros.

Enable all macros in the settings is activated and nothing is shown up in the makros list.

3
  • .xls? .xlsx? .xlsm?
    – jonrsharpe
    Commented Mar 21, 2014 at 9:26
  • @jonrsharpe .xlsx
    – Christian St.
    Commented Mar 21, 2014 at 9:27
  • 4
    You can't store macros in .xlsx, you should have saved it as .xlsm (Macro-enabled)
    – jonrsharpe
    Commented Mar 21, 2014 at 9:33

2 Answers 2

8

In Excel 2007 and above, files with macros have a different file extension.

Files without vba have the xlsx extension.

Files with macros need to be saved as a macro-enabled workbook with the xlsm extension.

For both file types there are also template variations, i.e. xltx and xltm respectively.

The default file format for a new file is xlsx, unless you change this setting in your Excel options.

If you include vba macros in the xlsx file and then try to save it, you will see a message that tells you that you cannot save macros in an xlsx file:

enter image description here

If you opt to ignore the message and save the file as a macro-free workbook, then please accept the fact that the macros will NOT be saved with the workbook.

You have seen the message. You have taken action NOT to save as a macro enabled file.

So, the macros are not saved with the file.

That's how it works.

2
  • I opened an Excel 2003 file (xls) that had macros. I can save the file as you suggest, but the macros are still missing. Please advise Commented Mar 30, 2015 at 12:55
  • Good example of how not to make UX :) Commented Jan 20, 2022 at 8:32
6

Click "No": Click No

Select "Excel Macro Enabled Workbook" and click "Save": Select the Excel Macro Enabled Workbook,Click Save Option

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .