@@ -608,32 +608,38 @@ def evaluate_formula(self, current_cell, name, arguments, interactive, destinati
608
608
if isinstance (destination , list ):
609
609
destination = [] if not destination else destination [0 ]
610
610
611
- if destination .data == 'defined_name' or destination .data == 'name' :
612
- defined_name_formula = self .xlm_wrapper .get_defined_name (destination .children [2 ])
613
- if isinstance (defined_name_formula , Tree ):
614
- destination = defined_name_formula
615
- else :
616
- destination = self .xlm_parser .parse ('=' + defined_name_formula ).children [0 ]
611
+ if (isinstance (destination , str )):
612
+ destination = self .xlm_parser .parse ('=' + destination ).children [0 ]
613
+
614
+ if isinstance (destination , Tree ):
615
+ if destination .data == 'defined_name' or destination .data == 'name' :
616
+ defined_name_formula = self .xlm_wrapper .get_defined_name (destination .children [2 ])
617
+ if isinstance (defined_name_formula , Tree ):
618
+ destination = defined_name_formula
619
+ else :
620
+ destination = self .xlm_parser .parse ('=' + defined_name_formula ).children [0 ]
617
621
618
- if destination .data == 'concat_expression' or destination .data == 'function_call' :
619
- res = self .evaluate_parse_tree (current_cell , destination , interactive )
620
- if isinstance (res .value , tuple ) and len (res .value ) == 3 :
621
- destination_str = "'{}'!{}{}" .format (res .value [0 ], res .value [1 ], res .value [2 ])
622
- dst_start_sheet , dst_start_col , dst_start_row = res .value
623
- else :
624
- destination_str = res .text
625
- dst_start_sheet , dst_start_col , dst_start_row = Cell .parse_cell_addr (destination_str )
626
- dst_end_sheet , dst_end_col , dst_end_row = dst_start_sheet , dst_start_col , dst_start_row
622
+ if destination .data == 'concat_expression' or destination .data == 'function_call' :
623
+ res = self .evaluate_parse_tree (current_cell , destination , interactive )
624
+ if isinstance (res .value , tuple ) and len (res .value ) == 3 :
625
+ destination_str = "'{}'!{}{}" .format (res .value [0 ], res .value [1 ], res .value [2 ])
626
+ dst_start_sheet , dst_start_col , dst_start_row = res .value
627
+ else :
628
+ destination_str = res .text
629
+ dst_start_sheet , dst_start_col , dst_start_row = Cell .parse_cell_addr (destination_str )
630
+ dst_end_sheet , dst_end_col , dst_end_row = dst_start_sheet , dst_start_col , dst_start_row
627
631
628
- else :
629
- if destination .data == 'range' :
630
- dst_start_sheet , dst_start_col , dst_start_row = self .get_cell_addr (current_cell ,
631
- destination .children [0 ])
632
- dst_end_sheet , dst_end_col , dst_end_row = self .get_cell_addr (current_cell , destination .children [2 ])
633
632
else :
634
- dst_start_sheet , dst_start_col , dst_start_row = self .get_cell_addr (current_cell , destination )
635
- dst_end_sheet , dst_end_col , dst_end_row = dst_start_sheet , dst_start_col , dst_start_row
636
- destination_str = XLMInterpreter .convert_ptree_to_str (destination )
633
+ if destination .data == 'range' :
634
+ dst_start_sheet , dst_start_col , dst_start_row = self .get_cell_addr (current_cell ,
635
+ destination .children [0 ])
636
+ dst_end_sheet , dst_end_col , dst_end_row = self .get_cell_addr (current_cell , destination .children [2 ])
637
+ else :
638
+ dst_start_sheet , dst_start_col , dst_start_row = self .get_cell_addr (current_cell , destination )
639
+ dst_end_sheet , dst_end_col , dst_end_row = dst_start_sheet , dst_start_col , dst_start_row
640
+ destination_str = XLMInterpreter .convert_ptree_to_str (destination )
641
+
642
+
637
643
text = src_eval_result .get_text (unwrap = True )
638
644
if src_eval_result .status == EvalStatus .FullEvaluation :
639
645
for row in range (int (dst_start_row ), int (dst_end_row ) + 1 ):
0 commit comments