I'm trying to insert a formula into a cell using VBA, the formula is an index and match to a closed workbook. I'm getting a Run-time error '1004': Application-defined or object-defined error:
Sub forecastData()
Worksheets("Mon").Range("R17").Formula = "=INDEX(""'""L:\ECommerce\Trading\Web Analytics\Reporting\KPI\[Ecom KPI.xlsm]Forecast""'""!$B$6:$B$2927,MATCH(""'""Update Data""'""!$E$2,""'""L:\ECommerce\Trading\Web Analytics\Reporting\KPI\[Ecom KPI.xlsm]Forecast""'""!$A$6:$A$2927,0))"
End Sub
Can anyone see where I've gone wrong?
Cheers