excel 2003 cannot read asp.net page output

F

Fendi Baba

I created an ASP.net page which opens excel. The data opens up
correctly in MS office Excel 2007 but when we use a mahcine with MS
Office 2003 we encountered a message, "Cannot read output file" Is
this caused by the Cridview or does anyone know what causes this.

Thank in advance.
 
J

Juan T. Llibre

re:
!>I created an ASP.net page which opens excel.

Calling Mark Rae!

:)

That is a *really* bad idea!

Just imagine what will happen if 100 users each open an instance of Excel on your server.
 
C

Charles

But i can perfectly imagine that an application uses excel as database. We
do that in a special application where nothing else can be used as database
for several reasons? And it works perfectly.

Ok to tell your point of view, but Fendi expects also an answer to his
problem.

So instead of typically answering the question by a lot of considerations
(true or not), you should also give an answer:
why this error with excel 2003? What if Fendi must use excel for a lot of
reaons? You give now the impression that one must be a fool to do that.
 
M

Mark Rae

But i can perfectly imagine that an application uses excel as database.

Absolutely! There's an Excel OleDb driver for that...
So instead of typically answering the question by a lot of considerations
(true or not), you should also give an answer:
why this error with excel 2003?

If you (re)read the OP, you'll see that he mentions that he's trying to
"open" Excel through ASP.NET - no mention of using Excel as an ADO.NET
datasource...

If the OP is trying to use server-side automation from ASP.NET, it is
virtually guaranteed not to work in a production environment...
What if Fendi must use excel for a lot of reaons?

Then, if he needs to do anything more than use Excel as an ADO.NET
datasource, he needs to use either OfficeXML or Aspose...
You give now the impression that one must be a fool to do that.

I never said he was a fool - I merely pointed out that server-side
automation from ASP.NET is actively discouraged by Microsoft because it
doesn't work; furthermore they actually will refuse to support any
application which even tries to use it:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2

I'm not making this up, nor am I trying to irritate anyone by telling them
that what they're trying to do is not going to work...

Juan was just having a little dig at me - that's cool... :)

But don't shoot the messenger...
 
A

Alvin Bruney [MVP]

That's a good point you've made. In the cases that I run across, there is no
better way than to automate Excel on the server. It can be done in a way
that provides efficient throughput bearing in mind that is swimming with the
aligators.
"Cannot read output file"
This is usually a permissions error. Couple things. Double-click on an
office file on the sick machine, see if that opens correctly. If it doesn't,
you'll need to re-install Office 2003.

Go ahead and re-install Office 2003 on the sick machine just for grins. Make
sure the Office PIAs are installed as well.

Alternatively, your next best better is to debug it. First try looking at
eventvwr to see what specific issue if any is occuring. It may typically be
related to the worker process not having sufficient rights.

If this fails, you will need to set your application to break on all
exceptions. Attach the debugger and wait till the automation event throws
and then step through the debugger to see what the issue is.
--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
https://www.microsoft.com/MSPress/books/10933.aspx
OWC Black Book www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
 
M

Mark Rae

That's a good point you've made. In the cases that I run across, there is
no better way than to automate Excel on the server. It can be done in a
way that provides efficient throughput bearing in mind that is swimming
with the aligators.

Just to clarify, Alvin, are you actually advising somebody (in your capacity
as MVP) to follow a procedure which Microsoft themselves will not
support...?
 
A

Alvin Bruney [MVP]

Just to clarify, Alvin, are you actually advising somebody (in your
capacity as MVP) to follow a procedure which Microsoft themselves will not
support...?


Wow, strong words. Yes I am. You tell kids not to play with fire because
fire can hurt them pretty bad right? Turns out, fire can be extremely
helpfull if you know how to use it. Sure, MS does not support server side
automation of Excel. I'm not arguing that, I'm saying there are ways to
automate Excel on the server if you operate between the limits - I spell out
those limits and let the developer decide after they understand that MS will
not provide support. That hasn't stopped people from automating Excel on the
server because there is a need that MS is yet to provide leadership on. Sure
there are products from MS that avoid the pitfalls but each is mired in
licensing that put those solutions out of the reach of common developer
shops. That's why you'll see a thread every week about excel automation in
here.

FWIW, you should not automate Excel on the server, it's single threaded and
ASP.NET runs on an MTS threadpool that, in essense, is the crux of the
matter. Ok, i've said enough and I'm certain to get into hot water for it...

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
https://www.microsoft.com/MSPress/books/10933.aspx
OWC Black Book www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
 
F

Fendi Baba

Thanks for the lively discussion. I am new to dot.net and I appreciate
the concern shown by everyone regarding the Excel automation. In this
instance, I am not using a server-side automation. I had merely places
the header in the page to ahev the following line

Response.ContentType = "application/vnd.ms-excel"


I had posted another thread with the full code:

http://groups.google.com/group/micr...a755020234f/7154e707aff0ce1d#7154e707aff0ce1d


Any ideas on what went wrong with MS Excel 2003 will be much
appreciated.

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top