I'm getting very cofused.
I'm assigning some data to a variant(vOrderdata) and then printing the variant to a new table row.
Everything works out, but when If I add the formula to vorderdata(7) I get error 400.
The code still works, but it raises an error 400.
Should I just capture the error and ignore it or is there actually something wrong?
Dim vOrderData(1 To 9) As Variant
Set loorder = Worksheets("Orderhantering").ListObjects("tblOrderdata")
vOrderData(1) = lOrdernumber
vOrderData(2) = sSuppliernumber
vOrderData(3) = sProjectnumber
vOrderData(4) = Date
vOrderData(5) = wsS.range("C15").Value
vOrderData(6) = "Genererad"
vOrderData(7) = "=SUMIF(Orderhistorik!I:I;[@Ordernr];Orderhistorik!F:F)"
loorder.ListRows.Add
lLastRow = loorder.DataBodyRange.rows.Count
loorder.ListRows(lLastRow).range.Value = vOrderData
Exit Sub
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…