Calling function.ets with VBA from ms-access

%3CLINGO-SUB%20id%3D%22lingo-sub-55190%22%20slang%3D%22en-US%22%3ECalling%20function.ets%20with%20VBA%20from%20ms-access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-55190%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20having%20a%20terrible%20time%20figuring%20this%20out.%26nbsp%3B%20Im%20trying%20to%20call%20Excel's%20function.ets%20function%20from%20an%20ms-access%20module.%26nbsp%3B%20I%20can%20call%20other%20functions%20without%20a%20problem.%26nbsp%3B%20I've%20got%20the%20arrays%20filled%20up%20and%20I've%20tried%20it%20a%20million%20ways%2C%20always%20with%20the%20same%20answer%20-%20%22VBA%20Error%201004%20Invalid%20number%20of%20arguments.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20-%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20forecastBackVar%20%3D%20objectVar.WorksheetFunction.Forecast.ets(testNowDate%2C%20testPointsARRAY%2C%20testDateARRAY%2C%200%2C%201%2C%205)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20forecastBackVar%20%3D%20objectVar.WorksheetFunction.Forecast.ets(testNowDate%2C%20Array(testPointsARRAY)%2C%20Array(testDateARRAY)%2C%200%2C%201%2C%205)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20forecastBackVar%20%3D%20objectVar.WorksheetFunction.Forecast.ets(Arg1%3A%3DtestNowDate%2C%20Arg2%3A%3DtestPointsARRAY%2C%20Arg3%3A%3DtestDateARRAY%2C%20Arg4%3A%3D0%2C%20Arg5%3A%3D1%2C%20Arg6%3A%3D5)%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Even%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20forecastBackVar%20%3D%20objectVar.WorksheetFunction.Forecast.ets()%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Someone%20suggested%20I%20try%20Forecast_ETS%2C%20and%20I%20got%20this%20back%20-%20%22VBA%20Error%201004%20Unable%20to%20get%20the%20Forecast_ETS%20property%20of%20the%20WorksheetFunction%20class.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHELP!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-55190%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-130871%22%20slang%3D%22en-US%22%3ERe%3A%20Calling%20function.ets%20with%20VBA%20from%20ms-access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-130871%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20having%20the%20same%20issue%2C%26nbsp%3BWhen%20I%20was%20trying%20out%20different%20combinations%20for%20the%20various%20non-default%20parameters%2C%20at%20just%20one%20point%20it%20worked%2C%20but%20when%20I%20manually%20refactored%20my%20code%2C%20it%20no%20longer%20works.%20Can't%20seem%20to%26nbsp%3Bremember%20what%20combinations%20worked.%20This%26nbsp%3Bpost%20may%20not%20be%20useful%20as%20an%20answer%2C%20but%20trying%20to%26nbsp%3Badd%20weight%20for%20this%20problem%20to%20gain%20traction.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
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)

    Even
    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."

 

HELP!!

 

1 Reply
Highlighted

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.