Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, you can do it with formula COMPLEX!

First, define a function converting the complex value to an Excel complex formula:

def complex_formula(cmplx):
    return "=complex("+str(totalload.real)+","+str(totalload.imag)+")"

Then use the function when writing to Excel:

wb.set_cell((1,'a'),complex_formula(totalload))

Yes, you can do it with formula COMPLEX!

First, define a function converting the complex value to an Excel complex formula:

def complex_formula(cmplx):
    return "=complex("+str(totalload.real)+","+str(totalload.imag)+")"
"=complex("+str(cmplx.real)+","+str(cmplx.imag)+")"

Then use the function when writing to Excel:

wb.set_cell((1,'a'),complex_formula(totalload))