I'm trying to save a new Excel File in the same folder with the original file name and current date, using Python 3.6 and the Datetime module.
The file is saved, but when I open the created file it says Excel cannot open the file 'AllData 2017_08_04.xlsm' because the file format or file extension is not valid.
How can I get the file to save correctly with the datestring included?
from datetime import datetime
os.chdir(r'\\URL\All Data Folder')
wb = openpyxl.load_workbook('AllData.xlsm')
datestring = datetime.strftime(datetime.now(), ' %Y_%m_%d')
wb.save('AllData' + datestring + '.xlsm')