Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
|
epplus [2024/08/26 09:55] jango |
epplus [2024/08/27 13:45] (aktuell) jango [Schreiben] |
||
|---|---|---|---|
| Zeile 2: | Zeile 2: | ||
| <code powershell> | <code powershell> | ||
| - | $epplusDllPath = "C: | + | $epplusDllPath = " |
| - | $excelFilePath = "C: | + | $excelFilePath = " |
| + | |||
| Add-Type -Path $epplusDllPath | Add-Type -Path $epplusDllPath | ||
| + | |||
| $package = New-Object OfficeOpenXml.ExcelPackage | $package = New-Object OfficeOpenXml.ExcelPackage | ||
| $package.Load([System.IO.File]:: | $package.Load([System.IO.File]:: | ||
| + | |||
| + | $ws = $package.Workbook.Worksheets[" | ||
| - | foreach ($ws in $package.Workbook.Worksheets) { | + | for ($row = 1; $row -le $ws.Dimension.End.Row; |
| - | + | $rowValues = @() | |
| - | Write-Output " | + | for ($col = 1; $col -le $ws.Dimension.End.Column; |
| - | + | $cellValue = $ws.Cells[$row, | |
| - | | + | $rowValues += $cellValue |
| - | $rowValues = @() | + | |
| - | for ($col = 1; $col -le $ws.Dimension.End.Column; | + | |
| - | $cellValue = $ws.Cells[$row, | + | |
| - | $rowValues += $cellValue | + | |
| - | } | + | |
| - | + | ||
| - | # | + | |
| - | Write-Output " | + | |
| } | } | ||
| - | + | Write-Output " | |
| - | break | + | |
| } | } | ||
| </ | </ | ||
| Zeile 192: | Zeile 184: | ||
| # Datei speichern | # Datei speichern | ||
| - | $package.SaveAs([System.IO.File]:: | + | |
| + | $package.SaveAs($filePath) | ||
| # Bestätigungsausgabe | # Bestätigungsausgabe | ||