df.insert() is not returning a dataframe. Just change this line:

df = df.insert(0,thing.Date)

to:

df.insert(0,thing.Date)

Answer from Josep Valls on Stack Overflow
🌐
Stack Overflow
stackoverflow.com › questions › 61663329 › python-error-attributeerror-nonetype-object-has-no-attribute-to-excel
Python Error: AttributeError: 'NoneType' object has no attribute 'to_excel' - Stack Overflow
import pandas as pd import glob raw_files = glob.glob(r'c:\test\Upload test\*.xlsx') pd_files = pd.DataFrame() for file in raw_files: pd_files.append(pd.read_excel(file)) pd_files.to_excel("c:\test\Uploaded\uploadfile.xlsx")
Discussions

python - AttributeError: 'Index' object has no attribute 'to_excel' - Stack Overflow
There are plenty of similar questions. Here are two: Python Error: AttributeError: 'NoneType' object has no attribute 'to_excel' AttributeError: 'Object has no attribute' I ... More on stackoverflow.com
🌐 stackoverflow.com
January 29, 2021
python - Pandas 'function' object has no attribute 'to_excel' - Stack Overflow
Communities for your favorite technologies. Explore all Collectives · Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work More on stackoverflow.com
🌐 stackoverflow.com
excel - New to Python and can't figure out "AttributeError: 'NoneType' object has no attribute 'to_excel'" - Stack Overflow
I am very new to python so an help or explanation is appreciated. I have read some of the similar questions but am not yet experienced enough to understand the solutions. I am using Python 3.6 in S... More on stackoverflow.com
🌐 stackoverflow.com
May 11, 2017
Sporadic 'NoneType' object has no attribute error
Python starts and xlwings Excel ... except, from time to time the script fails on the section that writes the data into the Excel (lines 48-53) The error thrown is either 'NoneType' object has no attribute 'Range' or 'NoneType' object has no attribute 'Worksheet'... More on github.com
🌐 github.com
4
September 1, 2022
🌐
Reddit
reddit.com › r/learnpython › trying to name a new file but can't figure out why i get an error.
r/learnpython on Reddit: Trying to name a new file but can't figure out why I get an error.
October 28, 2020 -
NewFileName = input('Name your file: ')
df.to_excel(NewFileName, ".xlsx", index=False)

Traceback (most recent call last): File "Rename.py", line 13, in <module>

df.to_excel(NewFileName, ".xlsx", index=False)

AttributeError: 'NoneType' object has no attribute 'to_excel'

🌐
CopyProgramming
copyprogramming.com › howto › python-error-attributeerror-nonetype-object-has-no-attribute-to-excel
Python: NoneType object does not have the attribute 'to_excel' causing AttributeError in Python
April 8, 2023 - NoneType Object Does Not Possess 'to_excel' Attribute: A Python Error, Understanding the Meaning of 'NoneType' Objects, Error Occurs Due to 'NoneType' Object's Inability to Use 'encode_plus' Attribute, Error Occurs: 'landmark' Attribute Not Found in 'NoneType' Object
🌐
GitHub
github.com › xlwings › xlwings › issues › 2005
Sporadic 'NoneType' object has no attribute error · Issue #2005 · xlwings/xlwings
September 1, 2022 - Python starts and xlwings Excel ... except, from time to time the script fails on the section that writes the data into the Excel (lines 48-53) The error thrown is either 'NoneType' object has no attribute 'Range' or 'NoneType' object has no attribute 'Worksheet'...
Author   CollierKing
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 70028527 › attributeerror-nonetype-object-has-no-attribute-group-while-running-differe
python - AttributeError: 'NoneType' object has no attribute 'group' while running different excel sheet - Stack Overflow
Pandas: trouble with to_excel using a grouped dataframe · 1 · AttributeError: 'NoneType' object has no attribute 'group' error · 1 · Save groupedby items to different excel sheet · Related questions · 0 · Pandas: trouble with to_excel using a grouped dataframe ·
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-fix-attributeerror-object-has-no-attribute
How to fix AttributeError: object has no attribute - GeeksforGeeks
July 23, 2025 - It typically consists of two parts: "AttributeError" and "Object has no attribute." The former indicates the type of error, and the latter suggests that the attribute we are trying to access does not exist for the object.
🌐
Stack Overflow
stackoverflow.com › questions › 68202325 › openpyxl-attributeerror-nonetype-object-has-no-attribute-lower
python - Openpyxl - AttributeError: 'NoneType' object has no attribute 'lower' - Stack Overflow
June 30, 2021 - I'm currently trying to read the excel file, check if the quote category (third column on the Excel sheet) is "attitude", and if so, then print out the first two columns (which are the quote itself and the author). I'm really stumped because even though I can see that category is indeed showing a proper value, the AttributeError is telling me otherwise.
🌐
Stack Overflow
stackoverflow.com › questions › 77349490 › attributeerror-nonetype-object-has-no-attribute-activesheet-even-though-the
python - AttributeError: 'NoneType' object has no attribute 'ActiveSheet' even though the excel workbook is running - Stack Overflow
import win32com.client #Attach to the running excel excel = win32com.client.GetActiveObject("Excel.Application") workbook = excel.ActiveWorkbook worksheet = workbook.ActiveSheet active_cell = excel.ActiveCell #Copy the active cell active_cell.Copy()
🌐
GitHub
github.com › xlwings › xlwings › issues › 2032
AttributeError: 'NoneType' object has no attribute 'apps · Issue #2032 · xlwings/xlwings
September 30, 2022 - Traceback (most recent call last): at block 11, line 7 at /opt/python/envs/default/lib/python3.8/site-packages/xlwings/main.pyline 279, in init(self, visible, spec, add_book, impl) AttributeError: 'NoneType' object has no attribute 'apps' import xlwings as xw # Use dict for your sheet/df mapping sheet_df_mapping = {"A": df, "B": df1, "C": df2} # Open Excel in background with xw.App(visible=False) as app: wb = app.books.open("output.xlsx") # List of current worksheet names current_sheets = [sheet.name for sheet in wb.sheets] # Iterate over sheet/df mapping # If sheet already exist, overwrite current cotent.
Author   Diarmaid005
🌐
GitHub
github.com › xlwings › xlwings › issues › 2432
nonetype object has no attribute "flush" · Issue #2432 · xlwings/xlwings
May 3, 2024 - I am trying to call the Import Function on the xlwings no Ribbon but iam getting the error "AttributeError: 'NoneType' object has no attribute 'flush'". The same error occurs when I try to run python scripts from excel.
🌐
Stack Overflow
stackoverflow.com › questions › 64762662 › attributeerror-nonetype-object-has-no-attribute-worksheets-in-python-win32c
excel - AttributeError: 'NoneType' object has no attribute 'Worksheets' in python win32com.client - Stack Overflow
November 10, 2020 - That is why you are getting an AttributeError when attempting to access wb.Worksheets(1). If nothing in the code has changed, it's likely that something in your spreadsheet is causing the error. You'll want to verify that the spreadsheet is in the correct location in addition to looking at any recent changes to the spreadsheet to determine what the actual cause of the problem is. ... There is no problem with the Excel sheet, it's just that your code opens up excel when you run your code, but never closes it i.e.
🌐
Xlwings
docs.xlwings.org › en › 0.24.5 › api.html
Python API — xlwings dev documentation
Activates the Excel app. New in version 0.9.0. ... Returns the native object (pywin32 or appscript obj) of the engine being used.
🌐
Intellipaat
intellipaat.com › home › blog › why do i get attributeerror: ‘nonetype’ object has no attribute ‘something’?
Why do I get AttributeError: 'NoneType' object has no attribute 'something'?
July 15, 2025 - In Python, we will get this type of error during coding. The error AttributeError: ‘NoneType’ object has no attribute ‘something’ occurs in Python when we try to access an attribute or method (something) on an object that is None.