dgorissen / pycel

A library for compiling excel spreadsheets to python code & visualizing them as a graph
GNU General Public License v3.0
573 stars 152 forks source link

AssertionError during set_value() #93

Closed hoffman32 closed 3 years ago

hoffman32 commented 4 years ago

I have the next Issue:

AssertionError Traceback (most recent call last)

in ----> 1 excel.set_value('Estados Financieros (1)!F377', 1200) 2 print("D1 is {}".format(excel.evaluate('Resumen (1)!D13'))) ~\Anaconda3\lib\site-packages\pycel\excelcompiler.py in set_value(self, address, value, set_as_range) 417 elif address not in self.cell_map: 418 address = AddressRange.create(address).address --> 419 assert address in self.cell_map Please help me
stephenrauch commented 3 years ago

Before setting a cell value, the cell needs to be put in to the cell map. To put a value into the cell map you can evaluate the address, or an address that references it.

You can also use the validate_calcs() method to populate the needed cell_map entries for any desired output cells.