0
votes

I've created a workbook which contains some macros along with it. My task is to save it including macros so that I'll be able to run them on the saved workbook. When I try to save it in ".xlsm" format--which is a standard format to save vba code--it's getting saved however, I'm unable to open the workbook from the desired saved file. The following window is displayed

" Excel cannot open the file "file.xlsm" because the file format or extension is not valid. Verify that the file is not corrupted and that the file extension matches the format of the file"

Can someone help me with this ? I've tried using ".xls",".xltm" formats as well. But, they don't save the vba code.

1
any code in the file you're saving? You have to save an Macro Enabled Workbookuser2140173
Was the workbook originally an "xls" and you just changed the file extension manually?rory.ap
@mehow: Yeah, it has code in it. Actually I've to run those macros everyday. So I need to save them along with the workbook. On the next day, if I run those macros it'll save a new file as per the date.pikachuchameleon
Possibly stupid question, but are you using Excel 2007+?David Zemens
Ok, sorry but this is not a programming question.. try asking this on Super User insteaduser2140173

1 Answers

0
votes

Try manually changing the file extension to ".xls" and then open it. If it opens, then do a "save as" in Excel and save it as "macro-enabled" (.xlsm).