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

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

Assisted Solution

PreachDotNet earned 1500 total points
ID: 16257758

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


Author Comment

ID: 16262511
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!)


Accepted Solution

PreachDotNet earned 1500 total points
ID: 16266953
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.


Author Comment

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

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
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…
Suggested Courses

850 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