Multiply PasteSpecial excel function with Powershell

Hi All,

I have excel workbook with rows, that are in text format. I manually multiply with ‘1’ to get them into Number format.

I am trying to accomplish this with powrshell script
Any help on this appreciated.


I Have tried to follow instructions as mentioned here, but I am still getting error

Range(“A2").PasteSpecial( -4163 , 4 )

Unable to find type [Microsoft.Office.Interop.Excel.xlPasteSpecialOperationMultiply]. Make sure that the assembly that contains this type is loaded.
At line:1 char:1

  • [void]$workSheet.Range(“A2").PasteSpecial([Microsoft.Office.Interop.Excel.XlPast …
  •   + CategoryInfo          : InvalidOperation: (Microsoft.Offic...erationMultiply:TypeName) [], RuntimeException
      + FullyQualifiedErrorId : TypeNotFound

Its working now
$rows = $WorkSheet.range(“A2”).currentregion.rows.count
$workSheet.Range("A2:A$Rows”).PasteSpecial( -4163 , 4 )