Mac – How to convert .xlsm to .xls without losing macros

macrosmicrosoft excelmicrosoft-excel-2007vba

I have an excel file (.xls) with macro, which was not created created by me. I pressed Alt+F11 and tried to expand the VBA project but I am prompted with "Enter Password" popup. Also the macro seems to work.

On the other hand I have another macro enabled excel (.xlsm) I am not able to save this file as .xls and retain the macros as well.

Can this be done?
Convert the file to .xls with macros enabled?

I have both MS Office 2010 as well as MS Office 2016 versions.

I want the file to be in .xls file format for my file handling library NPOI can read and write into the file from my ASP.net MVC application. I am not allowed to go for another library which can handle .xlsm files.

Warning I faced:
enter image description here

Best Answer

If you want to save an *.xlsm file in the old *.xls format, you need to select the appropriate file type in the Save As dialog.

enter image description here

An Excel 97-2003 workbook will not use a different file extension for macro enabled files and all VBA in the file will be retained. Be aware that there may be loss of functionality if you use features in the newer file that the older version cannot interpret.

Edit after you posted the screenshot:

the first warning is about data validation. The second one is something else, but most certainly not about VBA. Your VBA will make it into the .xls file and you'll need to run it to see if there are problems with the code. There are not many VBA command changes between these versions, so the code will probably run fine.

Related Question