It was not a problem with python or the program itself.
It was about the position in the terminal where you execute the program.
If you write your path as :
"myfile.xlsx"
your terminal has to be in the folder where your loaded excel file is.
And not to be confused with : "yes it should work if you put your excel file in the same folder as the .py file that you will execute."
So the answer was to put the full path like that :
"C:/myfullpath/toThe/file.xlsx"
or to use the cd command to move in the same folder (or working directory) as your excel file, from your terminal.
Otherwise, the function I wrote above is working well, and can help if you have to read, and edit an excel file with the openpyxl module using python.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…