Hi,
I am trying to run an excel macro file. The code below returns the error "expected <class âintâ> for the render_spreadsheet function.
Do you have an idea where this comes from?
Thanks for your help,
MĂ©lissa
@DataView("Excel", duration_guess=2)
def run_excel(self,params,**kwargs):
#input def
input_cells = [
# DirectInputCell('sheet1', 'E', 9, params.tab_1.section_0.configuration)
]
#macros def
macros = [Macro('CalcEp')]
area_cell = DirectOutputCell('sheet1', 'E', 46)
direct_output_cells = [
area_cell
]
template_path = Path(__file__).parent / 'check.xlsm'
#fill spreadsheet with values/text
with open(template_path, 'rb') as f:
template_as_bytes = BytesIO(f.read())
filled_spreadsheet = render_spreadsheet(template_as_bytes, input_cells)
#input excel arguments
excel = Excel(template=filled_spreadsheet, named_input_cells=input_cells,
macros=macros, direct_output_cells=direct_output_cells)
excel.execute(timeout=120)
return DataResult(area_cell.result)