[Help]How to open a Excel file with Asp.net(C#)!
-
:((i mean how to active office excel to open it(if suppose user have already installed),not to open it with IE! Tuliplanet
-
:((i mean how to active office excel to open it(if suppose user have already installed),not to open it with IE! Tuliplanet
Warning: Microsoft says that Microsoft Excel is not intended to be used with multi-threaded applications, and ASP.NET is a multi-threaded application. That being said, if you must open a Microsoft Excel worksheet, first, add a reference to your project to the COM library "Microsoft Excel 9.0 Object Library". Then, within your code:
Excel.Application xl = new Excel.Application();
xl.Workbooks.Open("book1.xls");What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
-
:((i mean how to active office excel to open it(if suppose user have already installed),not to open it with IE! Tuliplanet
You can also add the following to your page declaration: contenttype="application/vnd.ms-excel", or in you code-behind file use Response.ContentType="application/vnd.ms-excel"; There is a good example here: http://www.dotnet247.com/247reference/msgs/26/132455.aspx This really works well!! -Thea-