mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Add a Copy Source example
This commit is contained in:
11
Examples/AddWorkSheet/AddWorkSheet.ps1
Normal file
11
Examples/AddWorkSheet/AddWorkSheet.ps1
Normal file
@@ -0,0 +1,11 @@
|
||||
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
|
||||
|
||||
$xlSourcefile = "$env:TEMP\Source.xlsx"
|
||||
|
||||
Remove-Item $xlSourcefile -ErrorAction Ignore
|
||||
|
||||
$excel = 1..10 | Export-Excel $xlSourcefile -PassThru
|
||||
|
||||
Add-WorkSheet -ExcelPackage $excel -WorkSheetname "NewSheet" -CopySource $excel.Workbook.Worksheets["Sheet1"]
|
||||
|
||||
Close-ExcelPackage -ExcelPackage $excel -Show
|
||||
Reference in New Issue
Block a user