I'd like to copy (or move) a worksheet from one workbook to another workbook with Powershell.
I had done this before and cant remember how. I think I used CopyTo() function.
Just to get started.
$missing = [System.Type]::missing
$excel = New-Object -Com Excel.Application
$wb1 = $excel.Workbooks.Add($missing)
$wb2 = $excel.Workbooks.Add($missing)
# Now, to copy worksheet "Sheet3" from $wb2 into $wb1 as second worksheet.
# How?
See post from Kiron
Changed index to copy to second sheet: