title: how to prevent excel from crashing while running a macro on a large file?
body: <p>Good afternoon,</p>
  
  <p>I am running a macro which copies data to another workbook and automatically saves this workbook. The problem is that each line contains a picture, which makes it quite a large file, up to 30mb. Therefore the code takes a while to complete and when I try to run it again, Excel completely freezes and I have to force a shut down on it. When I copy fewer lines, it stays stable. I was wondering if it's a clipboard issue, but that is not the case. How does it come I can only run it once? Is it a cache issue or something? I am already using compressed pictures and application.screenupdating &amp; enablevents = false.</p>
  
  <p>Thanks in advance </p>
  
  <p>The code below is causing the freeze, basically each picture after row 6 needs to be resized.</p>
  
  <pre><code>    For Each pic In Ws3.Pictures
  pic.Select
   If Selection.TopLeftCell.Row &gt; 6 Then
   With Selection
  .Height = .TopLeftCell.RowHeight * 0.9
  .Width = .Height * PicWtoHRatio
  .Top = .TopLeftCell.Top + (.TopLeftCell.RowHeight - .Height) / 2
  .Left = .TopLeftCell.Left + (.TopLeftCell.Width - .Width) / 2
  End With
  End If
  Next pic
  End Sub
  </code></pre>
  
  <p>the problem also occurs in a nother part of the code, whenever i try to copy-paste >100 rows excel seems to freeze. i am using cutcopy = False.</p>