0

I'm trying to add a formula to a cell in excel via powershell but get an error

HRESULT: 0x800A03EC

I tried a lot of things including setting calculations to manual ($Excel.Calculation = -4153) but still get the same result. maybe I'm overlooking things or thinking to hard. Does somebody can help me whit this?

$i = 8
[String]$formula = "=IF(D$i>0;(I$i+L$i+Z$i+AA$i+J$i+K$i)/D$i;0)" 
$Excel_ws.Cells.Item( $i , 15 ).formula =  $formula
hexedecimal
  • 279
  • 1
  • 2
  • 9

1 Answers1

0

Similar to this question:

  • If you are using .formula, then the formula separator should be , and not ;

    "=IF(D$i>0,(I$i+L$i+Z$i+AA$i+J$i+K$i)/D$i,0)"
    
  • Otherwise, you can keep the ; and use .formulalocal instead of .formula.

BigBen
  • 46,229
  • 7
  • 24
  • 40