I\'m trying to develop a c#/asp.net application to extract data from a SQL server and have it formatted in an excel spreadsheet. I have been practicing with excel object mod
From that article:
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
What this means is that Microsoft won't explicitly prevent you from trying (the licensing allows you to try.) However, if there is a problem, it's up to you to figure out how to fix it.
There is a better option:
Create Excel (.XLS and .XLSX) file from C#
This will allow you to create the file for download without having to use Excel automation on the server side.
I can recommend the SpreadsheetGear library, it has all the Excel functions in one managed dll:
http://www.spreadsheetgear.com/
You 'can' use Excel automation on the server side. However you will be breaching licences ,may run into security problems and generally experience other odd behaviour, especially if you have more than one user using it at a time. I would suggest that you dont do it.
If the data you want to write is simple enough just do it as a csv
If not and you really have to write a spreadsheet look for a 3rd party component that writes excel files. I only know of one off the top of my head and thats Aspose.Cells, but that is quite expensive.