1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| $DateJ ="2021-10"
$file = $path2 +"\Global_test2.xls"
$EMPLOYEE_GLOBAL =$path2+"\DB-EMPLOYEE-GLOBAL_"+$DateJ+".csv"
$EMPLOYEE_GLOBAL_ACTIVE =$path3+"\DB-EMPLOYEE-GLOBAL_ACTIVE_"+$DateJ+".csv"
$EMPLOYEE_GLOBAL_INACTIVE =$path4+"\DB-EMPLOYEE-GLOBAL_INACTIVE_"+$DateJ+".csv"
$wb1 = $excel.workbooks.open($EMPLOYEE_GLOBAL, $null, $true) #open source, readonly
$wb2 = $excel.workbooks.open($file) #open target
#Recherche dans le dossier avec les fichiers Excel
$dossier = $path2
$dossiers = Get-ChildItem $dossier
#Création d'un fichier EXCEL
$file = new-item $file type file -force
#Lancer Excel
$excel = new-object -c Excel.Application
$excel.visible = $false
$excel.DisplayAlerts = $False
$wb2.Worksheets.item().add.name ="TOTALITE"
$wb2.Worksheets.item().add.name ="ACTIF"
$wb2.Worksheets.item().add.name ="HORS" |
Partager