473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Opening an Existing Excel Document using ASP.NET

When I try to programmatically open an existing Excel document using a custom
windows form, it works perfectly. I instanciate a new instance of the
Excel.ApplicationClass and then set the Visible property to 'true'...then I
open the workbook in question via my code.....
However, when I try this using ASP.NET. It does not work. I've messed
around and gave full access and control to my ASPNET user to practically
every darn folder on my machine...as you can see I am getting a bit crazy
trying to figure this out.....and that still does not seem to work.

What am I doing wrong?
Nov 19 '05 #1
4 3167
Remember to always closing your workbook before the page renders, or your
workbook will remain open when your page reloads, and Excel will force it in
read-only mode because someone else(even if the same person) is still
opening it.

In general, automating Office Application in ASP.NET is not a good idea, and
I'm not certain whether it violates the Eula or not...

"Josh Behl" <Jo******@discussions.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:61********************************* *@microsoft.com...
When I try to programmatically open an existing Excel document using a
custom
windows form, it works perfectly. I instanciate a new instance of the
Excel.ApplicationClass and then set the Visible property to 'true'...then
I
open the workbook in question via my code.....
However, when I try this using ASP.NET. It does not work. I've messed
around and gave full access and control to my ASPNET user to practically
every darn folder on my machine...as you can see I am getting a bit crazy
trying to figure this out.....and that still does not seem to work.

What am I doing wrong?

Nov 19 '05 #2
I believe this may be a dcom permissions error. You may be able to
check this by looking for a windows error log message about DCOM. Try
running dcomcnfg. Drill down to DCOM config. Add ASPNET user to the
security of the exel member of this list. I haven't actually done this
myself but I have seen that in quite a few places while researching a
similar problem.

Nov 19 '05 #3
Actually, I got it working by setting the Excel Application DCOM to
interactive user.

Works like a charm!

"ma********@gmail.com" wrote:
I believe this may be a dcom permissions error. You may be able to
check this by looking for a windows error log message about DCOM. Try
running dcomcnfg. Drill down to DCOM config. Add ASPNET user to the
security of the exel member of this list. I haven't actually done this
myself but I have seen that in quite a few places while researching a
similar problem.

Nov 19 '05 #4
I had the same problem. I wrote code to upload an Excel file then open the
file to retrieve data. There are some images in the worksheet. Any
suggestions as how you will approach it.

Thanks,

Richard Lo
"Lau Lei Cheong" wrote:
Remember to always closing your workbook before the page renders, or your
workbook will remain open when your page reloads, and Excel will force it in
read-only mode because someone else(even if the same person) is still
opening it.

In general, automating Office Application in ASP.NET is not a good idea, and
I'm not certain whether it violates the Eula or not...

"Josh Behl" <Jo******@discussions.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:61*********************** ***********@microsoft.com...
When I try to programmatically open an existing Excel document using a
custom
windows form, it works perfectly. I instanciate a new instance of the
Excel.ApplicationClass and then set the Visible property to 'true'...then
I
open the workbook in question via my code.....
However, when I try this using ASP.NET. It does not work. I've messed
around and gave full access and control to my ASPNET user to practically
every darn folder on my machine...as you can see I am getting a bit crazy
trying to figure this out.....and that still does not seem to work.

What am I doing wrong?


Feb 1 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jawahar Rajan | last post by:
All, I am using the ASP code below to save some data from a SQL Server database via ADO as an Excel spreadsheet strReportName = Request.QueryString("ReportName") If len(strReportName) > 0 then...
2
by: Brent Bortnick | last post by:
Hello, Is it possible to send data from ASP and put it into a existing template? i don't want to create an excel document I only want to send one piece of information from ASP to the Exisiting...
4
by: Marco Aschwanden | last post by:
Hi I would like to 1. import an existing Excel-sheet (a template) 2. and add some data to it 3. and save it under a different name afterwards. To me it seems, that pyExcelerator does not...
0
by: sandeep ch | last post by:
hi , I am opening a excel sheet from perl but every time i run the program i get a pop up message saying that "This Workbook contains links to other sources" " - To update all linked information...
2
by: Mad Scientist Jr | last post by:
>From an asp.net web page I want the user to open the results of a SQL query in Excel, as automatically as possible (ie not having to loop through columns, rows, in code). For this,...
0
by: QuenteK25 | last post by:
Ok so I'm pretty novice at all of this VB stuff, but I have to do a personal project for a class I'm in and it's in VB. So there are a few things I want to do for it that we have never covered in...
1
by: gowthamkumar | last post by:
HII ... please give me a code to open a new excel sheet using VB so that i can also directly add some contents in the cells of the excel sheet in VB itself .. i ve use the existing excel sheet code...
0
by: okalpana | last post by:
Hi friends, trying to do a application program.. what is the code to open a existing word document or excel file in Visual Basic 5 with a command button. i.e Clicking th button should open a...
16
by: Phil Stanton | last post by:
I have a form with a button which is supposed to open an Excel file (With lots of Macros /VBA) in it. The Excel file gets it's data from the Access program Here is the code Private Sub...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.