Trap set row and column on empty shet

This commit is contained in:
jhoneill
2018-10-24 17:14:33 +01:00
parent c38648a654
commit 1d5ec26b04
9 changed files with 6 additions and 0 deletions

4
.gitignore vendored
View File

@@ -2,6 +2,8 @@
Thumbs.db
ehthumbs.db
*.gitignore
# Folder config file
Desktop.ini
@@ -14,6 +16,8 @@ $RECYCLE.BIN/
*.msm
*.msp
*.dll
# Windows shortcuts
*.lnk

View File

@@ -131,6 +131,7 @@
$endRow = $Worksheet.Dimension.End.Row
}
process {
if ($null -eq $workSheet.Dimension) {Write-Warning "Can't format an empty worksheet."; return}
if ($Column -eq 0 ) {$Column = $endColumn + 1 }
$columnName = [OfficeOpenXml.ExcelCellAddress]::new(1,$column).Address -replace "1",""
Write-Verbose -Message "Updating Column $columnName"

View File

@@ -126,6 +126,7 @@
$endRow = $Worksheet.Dimension.End.Row
}
process {
if ($null -eq $workSheet.Dimension) {Write-Warning "Can't format an empty worksheet."; return}
if ($Row -eq 0 ) {$Row = $endRow + 1 }
Write-Verbose -Message "Updating Row $Row"
#Add a row label

BIN
__tests__/AllFour.xlsx Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
__tests__/Test Summary.xlsx Normal file

Binary file not shown.