The problem you are encountering is that the DATETIME macro contains a space, and you aren't quoting the macro value in the assignment.
Something like this will work better:
Application.Macros(vbldMacroTemporary).Add "TEST_DATETIME", "%DATETIME%"
Note: using .Add will ensure the macro exists with the value specified, creating if necessary
Kevin
|