in reply to Re: Win32::OLE PasteSpecial - why does xlPasteColumnWidths do not work
in thread Win32::OLE PasteSpecial - why does xlPasteColumnWidths do not work

Thanks a lot - that works. I was under impression that PasteSpecial needs to be called on source range and not target one. As an added bonus I can now preserve BOTH formulas and column width:
foreach $tab_idx (1..3) { $wsheet_out = $wbook_out->Worksheets($tab_idx); $wsheet_out->{Name} = $tab_names[$tab_idx - 1]; $range->Copy(); #to preserve formulas and column widths my $range_out = $wsheet_out->Range($wsheet_out->Cells(1,1), $wsheet +_out->Cells(1,1)); $range_out->PasteSpecial({Paste => $xlPasteFormulas}); $range_out->PasteSpecial({Paste => $xlPasteColumnWidths}); $wsheet_out->Paste();
  • Comment on Re^2: Win32::OLE PasteSpecial - why does xlPasteColumnWidths do not work
  • Download Code