Answers for "powershell merge excel"

0

powershell merge excel

$ExcelObject=New-Object -ComObject excel.application
$ExcelObject.visible=$true
$ExcelFiles=Get-ChildItem -Path C:\Users\Administrator\Desktop\excel

$Workbook=$ExcelObject.Workbooks.add()
$Worksheet=$Workbook.Sheets.Item("Sheet1")

foreach($ExcelFile in $ExcelFiles){
 
$Everyexcel=$ExcelObject.Workbooks.Open($ExcelFile.FullName)
$Everysheet=$Everyexcel.sheets.item(1)
$Everysheet.Copy($Worksheet)
$Everyexcel.Close()
 
}
$Workbook.SaveAs("C:\Users\Administrator\Desktop\excel\merge.xlsx")
$ExcelObject.Quit()
Posted by: Guest on October-14-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language