Is it possible to copy a macros enabled excel workbook? For example, I have:
from xlutils.copy import copy
from xlrd import open_workbook
from tempfile import TemporaryFile
book = open_workbook("book.xlsm")
book_copy = copy(book)
book_copy.save("bookcopy.xlsm")
book_copy.save(TemporaryFile())
However, when I then click on bookcopy.xlsm to open it, I get the following error: "Excel cannot open the file 'bookcopy.xlsm' because the file format or the file extesion is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."
I don't get this error when I save is as "bookcopy.xls", but I need it to be .xlsm. Does anyone have an idea what the problem is?