Error saving dump_worksheet. Write relations requires 4 parameters, 3 given.

Issue #502 resolved
Zahir Koradia
created an issue

The call to write_rels on line 252 in dump_worksheet.py passes three paramters, but the definition of write_rels in relations.py expects a fourth parameter vba_controls_id.

Assuming dump_worksheet.py is not inteded to preserve vba_controls passing a fourth param None in dump_worksheet.py:252 solves the problem.

Comments (6)

  1. Zahir Koradia reporter

    I was essentially trying to make a copy of a large sheet, eventually editing cell contents in the loop. This is what I was running.

    input_file = args[0]
    
    read_wb = load_workbook(input_file, data_only = True)
    read_sheet = read_wb.worksheets[0]
    
    write_wb = Workbook(optimized_write = True)
    write_sheet = write_wb.create_sheet()
    
    sheet_num = 0
    for read_sheet in read_wb.worksheets:
        sheet_num += 1
        print "Sheet: %s" % (sheet_num)
        write_sheet = write_wb.create_sheet()           
        row_num = 0
        for row in read_sheet.rows:
            row_num += 1
            print "Row: %s" % (row_num)
            write_row = []
            for cell in row:
                write_cell = WriteOnlyCell(ws = write_sheet, value = cell.value)
                write_cell.comment = self.clone_comment(cell.comment)
                write_cell.style = cell.style
                write_row.append(write_cell)
            write_sheet.append(write_row)
    
    write_wb.save('/tmp/op.xlsx')
    
  2. Log in to comment