mirror of
https://github.com/dfinke/ImportExcel.git
synced 2026-01-03 17:13:17 +00:00
Exposed ability to set a password on the sheet
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -45,3 +45,5 @@ InstallModule.ps1
|
||||
Export-Excel.ps1
|
||||
testExport.xlsx
|
||||
test.ps1
|
||||
testPwd.xlsx
|
||||
test.csv
|
||||
|
||||
@@ -53,6 +53,7 @@ function Export-Excel {
|
||||
[string[]]$PivotRows,
|
||||
[string[]]$PivotColumns,
|
||||
[string[]]$PivotData,
|
||||
[string]$Password,
|
||||
[OfficeOpenXml.Drawing.Chart.eChartType]$ChartType="Pie",
|
||||
[Switch]$IncludePivotTable,
|
||||
[Switch]$IncludePivotChart,
|
||||
@@ -137,6 +138,7 @@ function Export-Excel {
|
||||
}
|
||||
}
|
||||
|
||||
$ws.Protection.SetPassword($Password)
|
||||
|
||||
$pkg.Save()
|
||||
$pkg.Dispose()
|
||||
@@ -151,6 +153,7 @@ function Export-MultipleExcelSheets {
|
||||
$Path,
|
||||
[Parameter(Mandatory)]
|
||||
[hashtable]$InfoMap,
|
||||
[string]$Password,
|
||||
[Switch]$Show,
|
||||
[Switch]$AutoSize
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user