title: Word gets stuck during export via Excel VBA
body: <p>My Excel VBA script contains an export function which results in one Word document of about 12 pages.</p>
  <p>On my private computer, this works.</p>
  <p>On my company's laptop this seems to take too long and probably some kind of Word watchdog is triggered. Word gets stuck after about 75% of the code and the message &quot;Word has stopped working&quot; pops up.</p>
  <p>I determined the point where it gets too much for Word to handle. As the export code is quite extensive and also contains several company and project details that I don't want to reveal, I prefer to not post it here.</p>
  <p>Here is the snippet at which Word gets stuck:</p>
  <pre class="lang-vb prettyprint-override"><code>ThisWorkbook.Worksheets(&quot;Backup - Do not change&quot;).Shapes(&quot;companyLogo&quot;).Copy
  With wdFrontHeaderTable
      .rows.Height=30
      With .Cell(1,1).Range
          .Paste
          .ParagraphFormat.Alignment=0
      End With
      With .Cell(1,1).Range.InlineShapes(.Cell(1,1).Range.InlineShapes.Count)
          .LockAspectRatio=msoTrue
          .Width=120 'this one still works
      End With 'here, the error occurs
  End With
  </code></pre>
  <p>If I set one before that point and then run the two halves of code, one after another, it works.<br />
  If I uncomment the whole block, the error occurs in the next block.</p>
  <p>The code does what it is supposed to do, even on the company laptop. I guess it just takes too long and the watchdog &quot;thinks&quot; Word was stuck.</p>
  <p>Is there a way to disable the watchdog or another way to solve this?</p>
  <p>I tried Application.Wait (1000).</p>
  <p>Word is initialized by</p>
  <pre class="lang-vb prettyprint-override"><code>Dim wdApp As Object
  Dim wdDoc As Object
  Set wdApp = CreateObject(&quot;Word.Application&quot;)
  Set wdDoc = wdApp.Documents.Add
  </code></pre>