title: Excel copy paste range of cells
body: <p>How to copy/paste range of cells with preservation of cells' properties' values (row height/width for instance). I do the following:</p>
  
  <pre><code>$excel=new-object -comobject excel.application;
  $excel.visible=$true;
  $SourceWorkBook=$Excel.Workbooks.open("c:\ret.xls");
  $TargetWorkBook=$excel.workBooks.open("c:\test.xlsx");
  $SourceWorkBook.WorkSheets.item(1).activate();
  $SourceRange=$SourceWorkBook.WorkSheets.item(1).range("A6","P17");
  $SourceRange.copy() | out-null;
  $TargetWorkBook.worksheets.item(1).paste();
  </code></pre>
  
  <p>And result is messed up. Rows/columns' height/width differ from their original values. </p>