title: Change in code from excel 2010 to excel 2013 on .move
body: <p>I had code that worked perfectly in excel 2010- having upgraded to Office 365 and updating, the code now gives an error on the Move" method and then an "out of memory error" when running.  The code is as follows:</p>
  
  <pre><code>  For i = 1 To PrincipalNumber
     If PrincipalList(i) &lt;&gt; PrincipalList(i - 1) Then
     If InStr(1, PrincipalList(i), "(") &gt; 0 Then
      PrincipalName = Left(PrincipalList(i), 25) &amp; 0
     Else
      PrincipalName = Left(PrincipalList(i), 25)
     End If
     namefile = DirectoryName &amp; "\" &amp; PrincipalName &amp; "Full2"
     'Set sheets to save
     sheet5save = PrincipalName &amp; " NPT"
     sheet6save = PrincipalName &amp; " NP"
     sheet7save = PrincipalName &amp; "J"
     sheet8save = PrincipalName &amp; " JOBS"
     CurrentWorkBook.Sheets(Array(sheet5save, sheet6save, sheet7save, sheet8save)).Move
     ActiveWorkbook.SaveAs namefile, FileFormat:=xlOpenXMLWorkbookMacroEnabled
     ActiveWorkbook.Close
     CurrentWorkBook.Activate
   End If
  Next i
  </code></pre>
  
  <p>I have already split the code to try and see if it was limited by the number of sheets but that has made no difference (as can be see above, this only moves 4 sheets, prior to this I moved all 8 sheets at one).</p>
  
  <p>Anyone know of any specific changes in the versions that would lead to this error?</p>
  
  <p>EDIT:  After more experimentation I see this only occurs when I try to move a pivot table,  I can move standard data and pivot charts without a problem- but I cannto move the pivot table associated with a pivot chart without an error</p>
  
  <p>Thanks</p>