Looks like a couple of syntax errors (line 4 and 5). Try this:
time <- ts(.arg1, start = c(2010,1), frequency=12);
fcast <- forecast(time, h= .arg2);
n <- length(.arg1);
append(.arg1[(.arg2+1):n],fcast$mean, after = n-.arg2)",
SUM([Sales]), [Periods to Forecast])
Hope this helps!
Just to say. This code worked perfectly for me.
Thanks for the feedback, Robert! Glad to hear it worked!!