.bat failing with Task Scheduler

98 views
Skip to first unread message

Sarah Ritterspach

unread,
Jun 9, 2023, 5:00:51 AM6/9/23
to python-excel
Hi, all!

I have a .bat file that I've set up to run on my machine via the native Task Scheduler. The .bat reads a .py file that uses Xlsxwriter to write a few dataframes to an Excel file. When I run the .bat manually the script runs just fine and the file is created as expected. But when the .bat is run by Task Scheduler, a corrupt Excel file is created. The error message is 'Excel cannot open the file because the file format or file extension is not valid.'

I'm not positive that it's Xlsxwriter and Task Scheduler that aren't getting along, but that is my hypothesis. Has anyone else had this problem?

Thanks!
Reply all
Reply to author
Forward
0 new messages