0

I've been using Visual Basic Scripting Edition (VBS) for excel automation without much of a problem lately, however, when trying to set the value of a specific cell, programmatically, to this formula =IF(C3<IFERROR(VLOOKUP(<some_value>;A:D;4;FALSE);<some_value>);0;1) I keep getting the following error:

Unknow Runtime Error | CODE: 800A03EC

I've noted that a runtime error is raised when you try using VBS to assign a broken formula to a cell, however, when I tried to write that formula directly to excel it works perfectly.

Here's the snippet that I used when trying to do it by VBS:

AffiliatedWB.Worksheets("COLETA").Cells(IndicativeIndex, 5).Value = EvaluateGoal(CurrentGoal, IndicativeIndex)
' I also tried with:
AffiliatedWB.Worksheets("COLETA").Cells(IndicativeIndex, 5).Formula = EvaluateGoal(CurrentGoal, IndicativeIndex)

Both ways don't work. And yes, I checked the EvaluateGoal Function. It works perfectly and returns the formula string without any errors.

Any thoughts on a workaround?

Milky
  • 97
  • 1
  • 7

0 Answers0