def getFile():
global filename, path, path2
filename = QtWidgets.QFileDialog.getOpenFileName()[0]
path = filename
print(path)
I think the problem is in this function
def getTo():
wb = load_workbook(filename = filename)
and there is mising some settings in filename functon,
i tried using unicode, but it doesnt solve the problem
Traceback (most recent call last):
File "C:/Users/pro10/PycharmProjects/Program/gui5.py", line 118, in getTo
sheet['A' + str(rows)] = text1
File "C:Userspro10PycharmProjectspythonProjectvenvlibsite-packagesopenpyxlworksheetworksheet.py", line 313, in __setitem__
self[key].value = value
File "C:Userspro10PycharmProjectspythonProjectvenvlibsite-packagesopenpyxlcellcell.py", line 216, in value
self._bind_value(value)
File "C:Userspro10PycharmProjectspythonProjectvenvlibsite-packagesopenpyxlcellcell.py", line 199, in _bind_value
raise ValueError("Cannot convert {0!r} to Excel".format(value))
ValueError: Cannot convert <function text1 at 0x0000023DFE3D3A60> to Excel
question from:
https://stackoverflow.com/questions/65913049/cant-save-an-excel-file-using-python-script 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…