I'm using Python inside Pycharm, and wanting to scheduling code to run to open a workbook and save every day at a specified time. The function I've written to open and save the workbook has been working properly, but I'm now running in to two issues.
- I cannot Import time, it's greying out and I'm not sure why
- I'm receiving error "AttributeError: 'function' object has no attribute 'day'", and I'm not sure why. error occurs at ".day" within schedule function
import schedule import time
def Date_Table():
from openpyxl import load_workbook
wb = load_workbook(r'file path')
wb.save(r'file path')
schedule.every.day.at("1:00").do(Date_Table)