ImportExcel icon indicating copy to clipboard operation
ImportExcel copied to clipboard

Password protect Excel Files inside a folder

Open blhf opened this issue 7 years ago • 3 comments

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' }

blhf avatar Aug 14 '19 11:08 blhf

Get-ChildItem -Path 'C:\test' | foreach-object {
  $excel = Open-ExcelPackage -Path $_
  $excel.Save("QWERTY")
}

Should do it.

jhoneill avatar Aug 15 '19 14:08 jhoneill

Thank you for always helping.

blhf avatar Aug 19 '19 11:08 blhf

@jhoneill didn't know you could do that

dfinke avatar Aug 19 '19 14:08 dfinke