Multiply PasteSpecial excel function with Powershell

This topic contains 2 replies, has 1 voice, and was last updated by  Vishal Rao B 2 years, 1 month ago.

  • Author
  • #38223

    Vishal Rao B

    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.


  • #38224

    Vishal Rao B

    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

  • #38225

    Vishal Rao B

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

You must be logged in to reply to this topic.