How to write/update data into cells of existing XLSX workbook using xlsxwriter in python

后端 未结 5 819
说谎
说谎 2020-12-01 04:47

I am able to write into new xlsx workbook using

import xlsxwriter  
def write_column(csvlist):
    workbook = xlsxwriter.Workbook(\"filename.xlsx\",{\'strin         


        
5条回答
  •  一整个雨季
    2020-12-01 05:14

    Note that openpyxl does not have a large toolbox for manipulating and editing images. Xlsxwriter has methods for images, but on the other hand cannot import existing worksheets...

    I have found that this works for rows... I'm sure there's a way to do it for columns...

    import openpyxl
    
    oxl = openpyxl.load_workbook('File Loction Here')
    xl = oxl.['SheetName']
    
    x=0
    col = "A"
    row = x
    
    while (row <= 100):
        y = str(row)
        cell = col + row
        xl[cell] = x
        row = row + 1
        x = x + 1
    

提交回复
热议问题