session101 Posted May 10, 2006 Posted May 10, 2006 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? Quote
session101 Posted May 11, 2006 Author Posted May 11, 2006 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? Quote
Administrators PlausiblyDamp Posted May 15, 2006 Administrators Posted May 15, 2006 What errors are you getting? The more information you provide the better chance of getting an answer. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Arch4ngel Posted May 15, 2006 Posted May 15, 2006 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. Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
session101 Posted May 15, 2006 Author Posted May 15, 2006 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. Quote
Arch4ngel Posted May 16, 2006 Posted May 16, 2006 Tell me what you are trying to do and we might find an alternative. Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.