4

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

1 Answer 1

1

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.

8
  • 1
    as you mentioned I am prompted with functionality loss when I tried to save it as .xls that's why I posted the query.
    – RandomUser
    Commented Oct 14, 2016 at 5:11
  • 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.
    – teylyn
    Commented Oct 14, 2016 at 5:13
  • 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.
    – RandomUser
    Commented Oct 14, 2016 at 5:18
  • @RandomUser Did you actually try saving the file and then look at the result?
    – Daniel B
    Commented Oct 14, 2016 at 5:20
  • 1
    @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.
    – Daniel B
    Commented Oct 14, 2016 at 5:58

You must log in to answer this question.

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