Open Excel

session101

Newcomer
Joined
May 10, 2006
Messages
23
How do you open Excel in ASP.NET in read-only form?

I am using C# as the language and have tried to use:
1.) Process.Start() <-- Won't work for web servers
2.) Made a hyperlink to my Excel file

Is there a good way to open an Excel file with read-only permissions?
 
I create an Excel object with:

ExcelObj = new Excel.ApplicationClass();
ExcelObj.Visible = true;
Excel.Workbook theWorkbook = ExcelObj.Workbooks.Open(FILE_NAME, false, true, false, false, false, false, true, true, false, true, true, true, true, false);

But I still get errors when the program tries to launch Excel. What am I doing wrong?
 
From my experience, using the Excel application is not really a good idea. One of my problem I had was simply to close Excel. Everytime you declare an object you must free it with Marshal. If one of them is not realease, Excel won't quit.

Really troublesome on a web server where hundreds of users might open it. I suggest that you use something like CSV or any other file type. But learning what you want to do might help you find an alternate solution.
 
What is a good way to launch Excel via a web app instead of creating an Excel object? I tried to use process.start, but I dont think it works for web apps.
 
Back
Top