-
|
Hello, brand new to powershell I made a small script which should take leaf1 from the file toto.xlsx and export by making an addition in the file tata.xlsx of leaf1. I don't have an error message but it doesn't copy anything in your opinion, what am I missing in this script so that the data is added correctly? thank you in advance. here my script : #Charger les données de la feuille "Feuil1" du fichier source #Charger les données de la feuille "Feuil1" du fichier destination (s'il existe) #Ajouter les données du fichier source aux données de destination #Exporter les données vers le fichier destination avec la feuille "Feuil1" en mode ajout |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Thanks for using ImportExcel. You are not piping your data to Export-Excel. Try this. I would also recommend not using $cheminFichierDestination = "C:\Users\pmill755\desktop\report.xlsx"
Remove-Item $cheminFichierDestination -ErrorAction SilentlyContinue
$data = $(
Import-Excel "C:\Users\pmill755\desktop\toto.xlsx"
Import-Excel "C:\Users\pmill755\desktop\tata.xlsx"
)
$data | Export-Excel -Path $cheminFichierDestination -WorksheetName "Feuil1" -AutoSize -TableName "Donnees" -AutoFilter -Show |
Beta Was this translation helpful? Give feedback.
Thanks for using ImportExcel.
You are not piping your data to Export-Excel.
Try this. I would also recommend not using
NoHeader. Needed for theAutofilterto work best.