Update - I changed the output code to hard code the export file name:

dataSave(2,strf("History\\SPX_2019.t8",Ticker,Year));

I now have the .t8 file though can't interrogate it with ZHistoryEditor

Will try further tests