Connecting Tech Pros Worldwide Forums | Help | Site Map

Microsoft Office Excel cannot access the file (IIS7)

abb
Guest
 
Posts: n/a
#1: Jul 20 '08
On a Vista machine, the following code works using the ASP.NET
Development Server, but fails in IIS7:

book = excel.Workbooks.Open(tempfile,
false, false, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value,

In IIS7, the error is "Microsoft Office Excel cannot access the
file ... There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently
open workbook."


Both NETWORK SERVICE and IUSR have:
- read/write permissions on the temp folder
- Launch, Access, and Configuration permissions in DCOM Config for
Excel


I've also tried running the IIS application as my local adminstrator
account, but the same error occurs. It's IIS7 specific. What
permission does it need? Any ideas? Thanks.

Mark Rae [MVP]
Guest
 
Posts: n/a
#2: Jul 20 '08

re: Microsoft Office Excel cannot access the file (IIS7)


"abb" <andrewbb@gmail.comwrote in message
news:343bef99-65fa-4cd5-9643-aac8c6bdc833@w1g2000prk.googlegroups.com...
Quote:
Any ideas?
Yes, but you're not going to like them...

Server-side Office Automation is not recommended by Microsoft, nor is it
supported, for the simple reason that it doesn't work properly.

Microsoft Office simply wasn't designed to be run in this type of
architecture. See the following KB articles:
http://support.microsoft.com/default.aspx/kb/288367
http://support.microsoft.com/default...US;q257757#kb2

If you simply need to treat an Excel spreadsheet as a datasource, you can
use ADO.NET just like with any other database.

For any other usage, there is really only one solution which is guaranteed
to work:
http://www.aspose.com/categories/fil...a/default.aspx


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Joern Schou-Rode
Guest
 
Posts: n/a
#3: Jul 20 '08

re: Microsoft Office Excel cannot access the file (IIS7)


On Sun, 20 Jul 2008 10:08:28 +0200, Mark Rae [MVP]
<mark@marknospamrae.netwrote:
Quote:
For any other usage, there is really only one solution which is
guaranteed to work:
http://www.aspose.com/categories/fil...a/default.aspx
If you do not need anything fancy, you might be able to do with this free,
open-source library:
http://myxls.in2bits.org/

If you do need the fancy stuff, Aspose is the way to go.

--
Joern Schou-Rode
http://malamute.dk/
Mark Rae [MVP]
Guest
 
Posts: n/a
#4: Jul 20 '08

re: Microsoft Office Excel cannot access the file (IIS7)


"Joern Schou-Rode" <jsr@malamute.dkwrote in message
news:op.uelu6oyl31zpn8@marvin...
Quote:
If you do not need anything fancy, you might be able to do with this free,
open-source library: http://myxls.in2bits.org/
I've not seen that before - is it fairly new...?

I do understand that Aspose is simply too expensive for some potential
users, so this might be an excellent free alternative. Do you have any
experience with it...?


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

ZSvedic
Guest
 
Posts: n/a
#5: Jul 21 '08

re: Microsoft Office Excel cannot access the file (IIS7)


On Jul 20, 8:07*am, abb <andre...@gmail.comwrote:
Quote:
On a Vista machine, the following code works using the ASP.NET
Development Server, but fails in IIS7:
>
book =excel.Workbooks.Open(tempfile,
* * * * * * *false, false, Missing.Value,
* * * * * * *Missing.Value, Missing.Value, Missing.Value,
Missing.Value,
>
In IIS7, the error is "Microsoft OfficeExcelcannot access the
file ... There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently
open workbook."
>
Both NETWORK SERVICE and IUSR have:
- read/write permissions on the temp folder
- Launch, Access, and Configuration permissions in DCOM Config forExcel
>
I've also tried running the IIS application as my local adminstrator
account, but the same error occurs. *It's IIS7 specific. *What
permission does it need? *Any ideas? *Thanks.
I agree with Mark that there are many automation issues on the server:
http://www.gemboxsoftware.com/GBSpre...htm#Automation
Except previously mentioned myxls and Aspose.Cells, you can try our
free Excel R/W component: http://www.gemboxsoftware.com/GBSpreadsheetFree.htm
If you have XLS/CSV/XLSX files smaller that 150 rows it is free of
charge, otherwise it is $425 per developer (one time fee).
--Zeljko
=?Utf-8?B?VGltIEVyaWNrc29u?=
Guest
 
Posts: n/a
#6: Jul 24 '08

re: Microsoft Office Excel cannot access the file (IIS7)


The latest release (from July 9 - 2 weeks ago) will also do basic read
operations as well as write. It's not so new, but not getting any
Google-juice. It's my project on SourceForge.

"Mark Rae [MVP]" wrote:
Quote:
"Joern Schou-Rode" <jsr@malamute.dkwrote in message
news:op.uelu6oyl31zpn8@marvin...
Quote:
you might be able to do with this free,
open-source library: http://myxls.in2bits.org/
>
I've not seen that before - is it fairly new...?
>
I do understand that Aspose is simply too expensive for some potential
users, so this might be an excellent free alternative. Do you have any
experience with it...?
>
>
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
>
>
Closed Thread