>SET DEFAULT TO C:\dept >a=str(YEAR(DATE()))+"_"+TRANSFORM(MONTH(DATE())-1) >SET DEFAULT TO C:\dept\&a >gcDelimName = ALIAS( ) + '.xlsx' >gcDelimfile = forcepath(m.gcDelimName,'c:\dept\&a') >IF !EMPTY(m.gcDelimFile) > COPY TO (m.gcDelimFile) type xls& i try xlsx,xl5,and csv >ENDIF >>
a=TRANSFORM(dtos(DATE()-1), "@R 9999_99")and the Set default to then sees, after macro is expanded,
set default to c:\dept\ 2012_7and then stops parsing at the first space, then doesn't know what to do with the 2012_7 and gives you the error.
lcPath="c:\dept\"+a set default to (lcPath)That would have worked even if your path contained spaces, provided that the path exists.