473,509 Members | 3,075 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET and Excel._Worksheet.SaveAs

Jac
Hey,

We wrote a ASP.NET application and use excell for our reports.
But on my localhost everything works fine. The excell-file is saved and
opend. But when I try to excecute on the real machine I receive following
error

trace :
[COMException (0x800a03ec): The file could not be accessed. Try one of the
following:

• Make sure the specified folder exists.
• Make sure the folder that contains the file is not read-only.
• Make sure the file name does not contain any of the following characters:
< > ? [ ] : | or *
• Make sure the file/path name doesn't contain more than 218 characters.]
Excel._Worksheet.SaveAs(String Filename, Object FileFormat, Object
Password, Object WriteResPassword, Object ReadOnlyRecommended, Object
CreateBackup, Object AddToMru, Object TextCodepage, Object TextVisualLayout)
+0

But alle of the 4 points are correct (we also generate .pdf documents and
save them in the same directory with no problems)

Is there soemthing we didn't take in account?
I don't see the problem.

tkx
jac
Nov 16 '05 #1
2 7428
Hi,

Double check everything, in particular your path and also check that there
is not already a "read-only" file with the same name. On the folder, the
ASP.NET account needs certain priviledges. Modify, Read, Write, Create.

(Trace.Warn as much as you can...)

Also, check that ASP.NET account has priviledges to the Excel object. You
need launch and use priviledges. Check out dcomcnfg. (Also, there are some
other accounts from what I remember, NETWORK, SYSTEM and I think another
one.)

Excel (in fact, most office objects) shouldn't really be used in asp.net.
There can be licensing issues, but also, if your app fails whilst the object
is open, then your server will go slower as the object doesn't get closed.

Hope this helps.
Regards,
Dave Colliver.
http://www.LiverpoolFOCUS.com
~~
http://www.FOCUSPortals.com - Portal Franchises available

"Jac" <Ja*@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
Hey,

We wrote a ASP.NET application and use excell for our reports.
But on my localhost everything works fine. The excell-file is saved and
opend. But when I try to excecute on the real machine I receive following
error

trace :
[COMException (0x800a03ec): The file could not be accessed. Try one of the
following:

. Make sure the specified folder exists.
. Make sure the folder that contains the file is not read-only.
. Make sure the file name does not contain any of the following
characters:
< > ? [ ] : | or *
. Make sure the file/path name doesn't contain more than 218 characters.]
Excel._Worksheet.SaveAs(String Filename, Object FileFormat, Object
Password, Object WriteResPassword, Object ReadOnlyRecommended, Object
CreateBackup, Object AddToMru, Object TextCodepage, Object
TextVisualLayout)
+0

But alle of the 4 points are correct (we also generate .pdf documents and
save them in the same directory with no problems)

Is there soemthing we didn't take in account?
I don't see the problem.

tkx
jac

Nov 16 '05 #2
Make sure your ASP.NET worker process has security permissions to write to
the target folder...

Eran Kampf
http://www.ekampf.com

"Jac" <Ja*@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
Hey,

We wrote a ASP.NET application and use excell for our reports.
But on my localhost everything works fine. The excell-file is saved and
opend. But when I try to excecute on the real machine I receive following
error

trace :
[COMException (0x800a03ec): The file could not be accessed. Try one of the
following:

. Make sure the specified folder exists.
. Make sure the folder that contains the file is not read-only.
. Make sure the file name does not contain any of the following characters: < > ? [ ] : | or *
. Make sure the file/path name doesn't contain more than 218 characters.]
Excel._Worksheet.SaveAs(String Filename, Object FileFormat, Object
Password, Object WriteResPassword, Object ReadOnlyRecommended, Object
CreateBackup, Object AddToMru, Object TextCodepage, Object TextVisualLayout) +0

But alle of the 4 points are correct (we also generate .pdf documents and
save them in the same directory with no problems)

Is there soemthing we didn't take in account?
I don't see the problem.

tkx
jac

Nov 16 '05 #3

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

Similar topics

0
41149
by: I Decker | last post by:
Hi all, Hope this is the right group. I am writing a program in c# to open create an excel document, enter some data, save it and then email it as an attachment. I have successfully created...
1
10726
by: javzxp | last post by:
Hi I'd like to use C# to open an existing Excel workbook and save each worksheet it contains into a new Excel file. The name of each new Excel file should be the name of the worksheet copied...
1
3377
by: ʹÃûÑï | last post by:
hi: purpose: clone the firest sheet in Excel.xls into excel2.xls here is my code it well done in winform£º ------------------------------- string SubFile=@"D:\Excel2.xls"; string...
2
1975
by: Randy | last post by:
Hello, I'm trying to figure out how to do the above. I'm using a snippet of code I found on the net (see below). My problem is when I hit the line (oXL = new Excel.Application();) I get an...
1
4361
by: trialproduct2004 | last post by:
Hi all i am having application storing data in excel sheet. This applicaton is in C# .net. I want to update rows of excel sheet in C#. Can some one help me how to do it. please help me. Thanks...
1
4742
by: Girish | last post by:
Hi, I want to embed a txt document into an excel using python. Here is my code, but i get an error message =================================================== Traceback (most recent call...
1
1735
by: steveKC | last post by:
Hi, Anyone know how to extarct data from Oracle to excel without the header using vb.net? Below is my coding: Dim rst As ADODB.Recordset cn = New ADODB.Connection
3
6207
by: =?Utf-8?B?Um9k?= | last post by:
The applicacion sends me the next message "Method not found: Excel._Worksheet.SaveAs (..." I thinks that its about permissions but I do not know how to fix it. I have the same source in two...
1
6944
by: raul15791 | last post by:
Hi, I'm new to C#. I'm writing a program that open a new excel file, write into it and lastly close the file. But the program is that there will be a orphaned process named EXCEL.EXE left on the...
0
7234
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
7344
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
7412
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...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5652
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3216
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.