0
Je souhaite convertir la première ligne de mon fichier Excel en minuscules. Comment il faire:Python win32com convertir la première ligne en minuscule
import win32com.client
excel = win32com.client.Dispatch("Excel.Application")
excel.DisplayAlerts = False
excel.Visible=False
for i in files:
doc = excel.Workbooks.Open(filepath+'/'+str(i))
ws = doc.Worksheets(str(i).split(".")[0])
ws.Rows(1).Cells.Value=lower(ws.Rows(1).Cells.Value) #This syntax is wrong
ws.Rows(1).Replace("_","")
ws.Rows(1).Replace(" ","")
doc.Save()
doc.Close()
ws.Replace()
Essayez: 'ws.Rows (1) .Cells.Value = ws.Rows (1) .Cells.Value.lower()' –
Je reçois AttributeError: l'objet 'tuple' n'a pas d'attribut 'lower' @tmadam –