microsoft word / excel interop issue

Posted on 2007-10-17
Last Modified: 2010-05-18

I am working on word / excel automation project in which i am copying content from
Excel file to Word file using word template (.dot file).

I am using word & excel object library 11.0 , framework 1.1 on windows 2000 sp4.

Code :
//open excel file
oExcelApplic = new ApplicationClass ();
oWorkBook = oExcelApplic.Workbooks.Open(strFileName,0,true,5,"","",false,Excel.XlPlatform.xlWindows,"",false,false,0,false,missing,missing);
oWorkSheet = (Excel.Worksheet) oWorkBook.Worksheets.get_Item(1);

//open word file
oWordApplic = new Word.ApplicationClass();

object fileName = strFileName;
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;

// I get error at this line after file system change from FAT32 to NFTS
oDoc = oWordApplic.Documents.Open(ref fileName, ref missing,ref readOnly,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref isVisible,ref missing,ref missing,ref missing,ref missing);


Initially code was working fine when my file system was FAT32 with  <identity impersonate = "true" /> in config file

But after conversion to NTFS I get error  while opening word template file.
ERROR:-  "There is insufficient memory. Save the document now."

I have given necessary permission for word and excel in dcom manager but still got the same error. I even tried by giving all permissions to Everyone in dcom but in vain.

Please help me in this.

Any link about configuration / permission requirements  for using word / excel object libraries?
Question by:techprocess
    LVL 4

    Accepted Solution

    Trust me, I know from experience, this will not be the first problem you will face if you continue to impliment your solution using this technque. No attempt has been made by microsoft for Word to be used in an unnatended or non-interacive client.

    Quote from MS Site:
    "Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when run in this environment."

    Visit here for a detailed explantion of why it is a bad Idea!;EN-US;q257757
    LVL 4

    Expert Comment

    If you want to create docs server side, you will need to find a .NET component for Server side cretion of office documents. Some companys with suitable products are: -

    Aia Software B.V. -
    Polar -
    SoftArtisans -
    Keylogix - http://www.activedocs.comback to top
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
    Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
    The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
    Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

    794 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

    16 Experts available now in Live!

    Get 1:1 Help Now