This run-time message occurs if a value outside of the range 1-8 is passed to either of the macro functions MoonPhaseName or MoonPhaseSymbol.
If you use the value of nMoonPhaseIndex yourself, be sure to supply the correct index, as described here.
Topic 177665, last updated on 13-Apr-2020