Hmmm...are you by any chance using SAS Enterprise Guide??? I believe one of the default output types in SAS EG is HTML or SAS Report and in that case, the output is rendered as HTML or as though it is HTML and rendered as a browser would render it.
And, if you are using SAS EG, then the Results viewer is -different- from the LISTING destination/window. I apologize for not clarifying or asking the question about whether you were using EG or Display Manager.
When you use SAS EG, behind the scenes, you will see ODS statements being issued -- if you look in the SAS log -- you will see ODS HTML or ODS SASREPORT statements surrounding all your code. For EG, the Results Viewer simply surfaces the output -- rendering it in whatever form (using whatever internal transformation or plug-in, it needs to use to load the output into the Results Viewer). You can actually turn on the LISTING output in SAS EG, but folks don't do that very often -- given that it looks plain, plain, plain.
And, you're right, because EG treats the output like a browser would treat the output (and not like Excel treats the output), you may or may not get the look you want in the EG Results Viewer. One thing you can try is this -- from a CODE node in EG:
[pre]
ods _all_ close; /* close any "automatic" EG open destinations */
ods msoffice2k file='somefile.html' style=sasweb;
** insert some TABULATE code here;
ods msoffice2k close;
[/pre]
And one of 2 things will happen 1) either your output will look the same in the EG Results Viewer as it does in Excel (Yay!) or 2) your output will look different in the EG Results Viewer than it does when Excel opens the HTML file (Bummer!)
If it is #1, then you can figure out using EG options how to change your results from either SAS Report (XML) or "vanilla" HTML to MSOFFICE2K flavor of HTML. If it is #2, then there's not much point using a code approach to get MSOFFICE2K flavor of HTML.
Just a suggestion.
cynthia