ASP.NET and Excel._Worksheet.SaveAs

G

Guest

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
 
D

David

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
 

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

Top