jkwleisemann
New Member
- Joined
- May 31, 2016
- Messages
- 19
I'm trying to use Macro templates to create new workbooks, and as a part of that i want to save the template under a new name without the macros enabled. Here's what I'm doing with it:
The code works, but the problem I'm running into is that, obviously, it doesn't care for trying to save a non-macro file format that has macro code in it, and it generates "extension doesn't match file format" errors when I re-open it.
Any suggestions on how to clear up those two issues? Preferably without having to use the extensibility add-ins to delete all the VBA code?
Code:
strFileName = Application.GetSaveAsFilename(filefilter:="Excel Files (*.xls), *.xls")
If strFileName <> "" Then ActiveWorkbook.SaveAs Filename:=strFileName, FileFormat:=51, ConflictResolution:=xlUserResolution
The code works, but the problem I'm running into is that, obviously, it doesn't care for trying to save a non-macro file format that has macro code in it, and it generates "extension doesn't match file format" errors when I re-open it.
Any suggestions on how to clear up those two issues? Preferably without having to use the extensibility add-ins to delete all the VBA code?