Many thanks to all who have provided the help and support : Cynthia, OS2_Rules, and some support from SAS Customer Support in UK
The only proc template excelXP override which I found to work and produce valid xml, was the final code OS2_rules was able to generate.
The unexpected feature I found I had to add, appears in my tabulate style code on the proc statement[pre]
proc tabulate style= [ tagattr='format:#,##0"" "";[Red]-#,##0"" ""']
[/pre]
(That style element affects the data cells of analysis variable statistics.)
Normally we might add a trailing character in an excel custom format like
[pre] 'format:#,##0" ";[Red]-#,##0" "' [/pre]
However this style element gets inserted within "double quotes" and I think the interpretation of a pair of ", within a pair of " gets confused and so ignored.
This was the (less effective) xml [pre] <NumberFormat ss:Format="#,##0" ";[Red]-#,##0" "" /> [/pre]
When the extra quotes are added, the result looks better, and it works for me ! [pre] <NumberFormat ss:Format="#,##0"" "";[Red]-#,##0"" """ />[/pre]
again, many thanks
PeterC