We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Win 2k3 IIS Word XP Not enough storage is available to complete this operation

Medium Priority
Last Modified: 2013-11-15
Hi all,

We've been searching the web and trying all sorts of things but to no avail. Can anyone help?

Let me fill you in...
Windows 2003 Server, IIS running an ASP.NET application on a virtual server (using VMWare)
Word 2003 is being automated from inside a webservice using: CreateObject("Word.Application")

Word loads a template, does some merging based on some SQL data and saves the resulting file. The called webmethod then returns the filename to the client which they open .......

This code has been installed on over 20 sites so far. We've had various problems with read-only documents coming through etc but all have been solved. This is the latest installment:
Completely randomly the word application fails to quit (the last line of code before returning to the client).
The error given is: "not enough storage is available to complete this operation"

A reboot sorts the problem for the first couple or three attempts, then the error starts again. Clearing down temporary files through IE works again for a couple of times but then it happens again.

The server is beefy, with plenty of hard drive space and ram (a few GB of each).
We found out about the virtual server part late so to make sure that our instance was getting enough memory we manually set the page file size to between 1536MB and 3072Mb (doubling the size previously allocated) but again no help.

We've written a VB.NET app which literally loads word, reads the version then quits and this runs fine. Now true we're not doing any merging here so thats probably the next stage but I'm seriously starting to run out of ideas!

If anybody has any help or suggestions, please reply

Many thanks
Watch Question


Maybe a garbage collection issue?  Microsoft strongly advises against serving word through IIS due to problems with deadlocks etc, you might be finding this problem.

How are you quitting word?  with             oWordApp.Quit() ?

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


I know we shouldnt be using word in automation, BUT, how are we supposed to generate word documents automatically?  I cant beleive we are the only ppl in the world who want todo this!

But yes.  The command the routine is failing on is l_objWord.Quit.  AND the word does quit (ie it disappears out of the task list!)

You aren't the only people, I have done exactly the same with no problems.  I am going to be changing the system as soon as is humanly possible though.  We run crystal reports and that has an export to pdf function that can be accessed programmatically.  Anyway, I digress...

I did have to add a MAPI filter on mine in IIS to handle the .docs, more from a security standpoint though.

Heres how I instantiate the object ....

        Dim missing As Object = System.Reflection.Missing.Value
        Dim fileName As Object = "C:\\test.doc"
        ' template file name
        Dim newTemplate As Object = False
        Dim docType As Object = 0
        Dim isVisible As Object = True
        Dim oWordApp As Word.ApplicationClass = New Word.ApplicationClass

            Dim oWordDoc As Word.Document = oWordApp.Documents.Open( _
                fileName:=fileName, _
                ConfirmConversions:=False, _
                ReadOnly:=False, _
                AddToRecentFiles:=False, _
                PasswordDocument:="", _
                PasswordTemplate:="", _
                Revert:=False, _
                WritePasswordDocument:="", _
                WritePasswordTemplate:="", _

Heres how I close it ...

            oWordDoc.SaveAs("C:\\Inetpub\\wwwroot\\SharedDir" & docName) 'SearchForMe.doc")

            Return docName
        Catch ex As Exception

Not sure if this will work in place of your create object statement.  Don't forget to add the object model to references.


It would appear that it is something todo with the instance of our VM machine. After reinstalling it, all works fine.... Great!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.