title: MS Word Interop C# RPC_E_SERVERCALL_RETRYLATER Error
body: <p>So I keep getting the "Application is busy" RPC_E_SERVERCALL_RETRYLATER error with the following code.  It is worth noting that this exact code worked fine with Word 2003 and .doc files.  After upgrading to 2007, it is no longer working.  The file it getting the section count of is a ".docx" and I have made sure to use the proper version of the interop.  The error occurs at a random location in the code usually.</p>
  
  <pre><code> public int GetSectionsCount(string fileName) {
              wrdApp = new Application();
              Object file = fileName;
              Documents docs = wrdApp.Documents;
              wrdDoc = docs.Open(ref file, ref oMissing, ref oMissing,
                                                         ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                                                         ref oMissing,
                                                         ref oMissing,
                                                         ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                                                         ref oMissing,
                                                         ref oMissing,
                                                         ref oMissing);
              int count = wrdDoc.Sections.Count;
              wrdDoc.Close(ref oFalse, ref oMissing, ref oMissing);
              wrdApp.Quit(ref oFalse, ref oMissing, ref oMissing);
              Marshal.ReleaseComObject(docs);
              Marshal.ReleaseComObject(wrdDoc);
              Marshal.ReleaseComObject(wrdApp);
              wrdDoc = null;
              wrdApp = null;
              return count;
          }
  </code></pre>
  
  <p>An example stacktrace:</p>
  
  <pre><code>   at Microsoft.Office.Interop.Word.DocumentClass.get_Sections()
     at MyApplication.WordMerge.split(String fileToSplit, String whereToSave, String quarterExtension, Form1 pb) in\\Projects\\MyApplication\\WordMerge.cs:line 176
     at MyApplication.PMLettersManager.DoSplits() in \\Projects\\PyForms3\\PMLettersManager.cs:line 179
     at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
     at System.Threading.ThreadHelper.ThreadStart()
  </code></pre>
  
  <p>The code is run in its own thread and no other MS Word automation code is run concurrently.  Again, it worked fine before upgrading.</p>
  
  <p>EDIT: When I saved the file in question as a .DOC instead of .DOCX there were no errors and the code worked fine.</p>