I wrote the following formula in Excel originally in order to concatenate a bunch of data.
I am trying to pass the formula into Excel from Access in order to run the concatenation on selected files. However I keep getting an "Application-defined or object-defined error".
Code:
=TEXTJOIN(";",TRUE,IF(A:A=A2,B:B,""))
Code:
Dim xlFormula as String
Dim xlSheet as Excel.Worksheet
xlFormula = "=TEXTJOIN("""";"""",TRUE,IF(A:A=A2,B:B,""""))"
With xlSheet
.range("C2").formula = xlFormula
End With