ImportExcel
ImportExcel copied to clipboard
Password protect Excel Files inside a folder
Hi I would like to know if I can do a bulk password protect all excel workbooks inside a folder?
$FilePath = 'C:\test' $FileName = Get-ChildItem -Path 'C:\test' -Name
ForEach( $files in $filename) { Import-Excel -Path $(-Join($FilePath,$files) -Password 'QWERTY' }
Get-ChildItem -Path 'C:\test' | foreach-object {
$excel = Open-ExcelPackage -Path $_
$excel.Save("QWERTY")
}
Should do it.
Thank you for always helping.
@jhoneill didn't know you could do that