Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script that generates an Excel spreadsheet that appears to be working all the way until it reaches the SaveAs() call. I've tried changing DCOM settings, Application pool settings, impersonation settings in web.config and none of them seem to do anything.

Is there anything I'm missing?

share|improve this question

Obvious question I suppose, but have you checked you have access to the folder where the spreadsheet is being saved? From the tags I'd guess this is being done from an ASP.Net page on a web server in which case it will be running as either the user opening the page if you're using authentication or as, erm, something else if it's anonymous access.


share|improve this answer
That was the first thing I checked. I was able to write a simple text file with no problems so the folder permissions doesn't seem to be the problem. I've tried writing to other folders that allow Everyone full access but Excel interop keeps throwing an exception. Perhaps it's a Session 0 problem? – wm_eddie Jun 22 '09 at 7:08

Are you doing Excel automation on the server side? Then if I were you, I would consider the advice provided in KB 257757.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.