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

Posted on 2006-03-22
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
Question by:sarahclements
    LVL 6

    Assisted Solution


    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() ?

    LVL 1

    Author Comment

    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!)

    LVL 6

    Accepted Solution

    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.

    LVL 1

    Author Comment

    It would appear that it is something todo with the instance of our VM machine. After reinstalling it, all works fine.... Great!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
    This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now