In my ASP.Net application I\'m generating a Excel file using MsExcel Object Libby (Com-InterOp) . The application worked fine in the VS dev. environment.
But when I
Using Office Interop on the server is NOT supported by MS - see http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2
Since Windows Vista MS introduced several security-related measures which prevent a Windows Service (IIS is just a special case of that) from doing "desktop-like" things... which means you would have to circumvent several security measures (impersonation alone won't cut it!) to get it to work (NOT recommended!).
NOTE that the Integrated VS web server does NOT simulate the behaviour of IIS regarding permissions etc.
To deal with Excel in a server-scenario there are several options (free and commercial) out there:
I can recommend Aspose.Cells and Flexcel... didn't try SpreadsheetGear but hear+read lots of good things about it.
Free options (though for xlsx format only!) are for example OpenXML 2 from MS and EPPlus.