How to convert .xlsm to .xls without losing macros?

13,160

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.

Share:
13,160

Related videos on Youtube

RandomUser
Author by

RandomUser

A passionate software engineer

Updated on September 18, 2022

Comments

  • RandomUser
    RandomUser over 1 year

    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

  • RandomUser
    RandomUser over 7 years
    as you mentioned I am prompted with functionality loss when I tried to save it as .xls that's why I posted the query.
  • teylyn
    teylyn over 7 years
    Functionality loss does not mean that the macros won't survive. Why do you need to save in the old format? If you need the old format, you should develop in the old format.
  • RandomUser
    RandomUser over 7 years
    Like I have mentioned in the question, I didn't create the file and I need the file to be in .xls for my existing implementation to work smoothly.. Thanks for the effort though I appreciate it.
  • Daniel B
    Daniel B over 7 years
    @RandomUser Did you actually try saving the file and then look at the result?
  • RandomUser
    RandomUser over 7 years
    @DanielB I didn't since it threw the function loss warning
  • RandomUser
    RandomUser over 7 years
    @DanielB I updated my question with the warning I faced and without the feature mentioned in the warning it's pointless saving the file in .xls format
  • Daniel B
    Daniel B over 7 years
    @RandomUser The warning isn’t really that specific. That’s why: Try it. You’ll still have the original file, so nothing will be lost.
  • teylyn
    teylyn over 7 years
    I updated my post