Python generates corrupt excel file with .insert_bitmap

297 Views Asked by At

My code gives me a corrupted .xls file, and i don't know why; it only happens when I try to insert a bitmap (sheet1.insert_bitmap(r"bmp.bmp", 0, 0)) What could be the problem?

import xlwt

book = xlwt.Workbook()
sheet1 = book.add_sheet("error")
sheet1.insert_bitmap(r"bmp.bmp", 0, 0)
book.save("error.xls")

Edit2: I put the created file in a shared folder, and 2 out of 5 computers opened it in protected view, the other 3 opened it normally. All the computers used Excel 2010.

0

There are 0 best solutions below