Hi:
Welcome to the world of Excel doing what it wants with your output from SAS. What you have discovered is that Excel will use a general number format -- if your variable is a character variable in the SAS dataset and even if you have a SAS report that shows the number correctly (NOT in scientific notation).
There is a fix for this, but the fix involves using STYLE= overrides. If you are creating output with HTML-based methods, such as ODS HTML or ODS MSOFFICE2K (preferred because it is "Microsoft flavor of HTML") , then your STYLE= override would reference the HTMLSTYLE= attribute. If you are creating XML based output, such as with ODS TAGSETS.EXCELXP, then your STYLE= override would reference the TAGATTR= attribute.
I see that you are trying to use a HEADTEXT= to pass in a custom number format... I don't know whether Excel will actually respect CSS passed in this way. It was with INLINE styles that Microsoft disagreed with the W3C on HTML 4 -- that's why they came up with their own flavor of HTML.
I'd recommend that you try the direct approach shown below, using a destination that Microsoft likes AND using the direct approach with the text format. And, you can also refer to this Tech Support note that has code that shows the use of HTMLSTYLE with the @ value for the mso-number-format style property.
http://support.sas.com/kb/32/414.html (do note that the example uses MSOFFICE2K for the HTML file -- which is what I would recommend) Microsoft "likes" its own type of in-line style and I'm not sure it will use an HTMLCLASS in the same way that a standard browser will use HTMLCLASS. I think HTMLSTYLE is the better way to go.
cynthia
[pre]
ods msoffice2k file = "C:\testing files\laboutput %sysfunc(today(),date9.).xls" ;
ods noptitle;
PROC PRINT data= foura NOOBS BLANKLINE=5 LABEL SPLIT='*';
VAR NEWID /style={htmlstyle="mso-number-format:\@"};
VAR VISITDATE ASSESSVISITDATE;
LABEL VISITDATE='Weekly*VisitDate'
ASSESSVISITDATE='*Med*AssessDate';
FORMAT NEWID $13. ;
RUN;
ods msoffice2k close;
[/pre]