My sub opens up a .xlsm file in a new Excel instance, makes changes to the file, and saves the changes.
However, despite the fact that the file being opened is .xlsm, upon workbook.save I get the alert message "the following features cannot be saved in macro-free workbooks..."
This doesn't make sense to me because the file is .xlsm. Any ideas?
Edit: I believe I found the source of the problem. Although the variable "path" contains C:\file.xlsm, wkb.path is empty. (see Debug.print's below). Why is the wkb.path empty?
Set XL = New Excel.Application
XL.Visible = False
For Each Path In XLSMPaths
Set wkb = XL.Workbooks.Add(Path)
Debug.Print Path ' "C:\file.xlsm"
Debug.Print wkb.path ' ""
Debug.print wkb.name ' "file"
wkb.Save '<- alert message "The following features cannot be saved in macro-free workbooks..."
Next Path