Author Posts

April 25, 2016 at 1:39 pm

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.

-Vishal

April 25, 2016 at 2:27 pm

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

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

https://github.com/OfficeDev/VBA-content/blob/master/Excel-VBA/articles/d3e991f2-7ef7-2ebc-d4bc-ba4c26be472e.md

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

April 25, 2016 at 2:35 pm

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