Calling function.ets with VBA from ms-access

Occasional Visitor

I'm having a terrible time figuring this out.  Im trying to call Excel's function.ets function from an ms-access module.  I can call other functions without a problem.  I've got the arrays filled up and I've tried it a million ways, always with the same answer - "VBA Error 1004 Invalid number of arguments."


I've tried -

    forecastBackVar = objectVar.WorksheetFunction.Forecast.ets(testNowDate, testPointsARRAY, testDateARRAY, 0, 1, 5)
    forecastBackVar = objectVar.WorksheetFunction.Forecast.ets(testNowDate, Array(testPointsARRAY), Array(testDateARRAY), 0, 1, 5)
    forecastBackVar = objectVar.WorksheetFunction.Forecast.ets(Arg1:=testNowDate, Arg2:=testPointsARRAY, Arg3:=testDateARRAY, Arg4:=0, Arg5:=1, Arg6:=5)

    forecastBackVar = objectVar.WorksheetFunction.Forecast.ets()
    Someone suggested I try Forecast_ETS, and I got this back - "VBA Error 1004 Unable to get the Forecast_ETS property of the WorksheetFunction class."




1 Reply

I am having the same issue, When I was trying out different combinations for the various non-default parameters, at just one point it worked, but when I manually refactored my code, it no longer works. Can't seem to remember what combinations worked. This post may not be useful as an answer, but trying to add weight for this problem to gain traction.