I need to achieve the following when opening an HTML in Excel (Response.contentType=\"application/vnd.ms-excel\") :
The best trick is to mock up an Excel spreadsheet with all the colors/(conditional) formats/formulas you require.
Keep it as simple as possible, just the bare minimum rows etc.
Then save the Excel spreadsheet "As Xml Spreadsheet"
Then you have a template to build a spreadsheet via Xml.
I generally clean up styles in the original Xml saved from the Excel workbook. Removing duplicates and renaming them.
Then it is just a matter of populating with whatever datasource you have.
I do not know what environment you are coding to, but in VB.NET with LINQ and Xml Literals, this is a very simple task.