I am new to programming. I am learning to write in the python language. I am currently trying to put an existing dictionary into a new excel file. I have a feeling that because I have a dictionary may be the issue? I am using openpyxl.
I am getting an error message(AttributeError: 'WriteOnlyWorksheet' object has no attribute 'cell' ) whenever I attempt to insert the dictionary. However I can write to a simple cell with no issue. It is when trying to fill in large data into a column that I get the error.
#Writing a new excel file with key information
print("Would you like to create a new excel document?")
b_input = input("Type: 'Y' or 'N' -> ").lower()
if b_input == "y":
wb = Workbook(write_only=True)
ws = wb.create_sheet()
print("I can only put in the contract status and serial numbers together in a file.")
c_input = input("Would you like to do that? Type: 'Y' or 'N' -> ")
if c_input == 'y':
ws.cell(row=r, column=1).value = excel_info
wb.save('new_test_book.xlsx')