By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,543 Members | 2,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,543 IT Pros & Developers. It's quick & easy.

Microsoft Office Excel cannot access the file (IIS7)

P: n/a
abb
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.
Jul 20 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"abb" <an******@gmail.comwrote in message
news:34**********************************@w1g2000p rk.googlegroups.com...
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

Jul 20 '08 #2

P: n/a
On Sun, 20 Jul 2008 10:08:28 +0200, Mark Rae [MVP]
<ma**@marknospamrae.netwrote:
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/
Jul 20 '08 #3

P: n/a
"Joern Schou-Rode" <js*@malamute.dkwrote in message
news:op.uelu6oyl31zpn8@marvin...
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

Jul 20 '08 #4

P: n/a
On Jul 20, 8:07*am, abb <andre...@gmail.comwrote:
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
Jul 21 '08 #5

P: n/a
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:
"Joern Schou-Rode" <js*@malamute.dkwrote in message
news:op.uelu6oyl31zpn8@marvin...
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

Jul 24 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.