Before anyone can tell you how to resolve "it", we need to know what is causing this problem.
right after the let varMaxDate = Peek(...); statement. Reload your document and check the content of varMinDate and varMaxDate in the Settings->Variable Overview dialog. Do they contain numerical values?
The error is occuring here:
$(varMinDate) + Iterno()-1 as Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);
Set vFM = 4 ; // First month of fiscal year
I'm using Microsoft Visual Studio so myself and a colleague can co-develop. When he reloads he doesn't get any errors and has the exact same script that I have!