Re-instated trap for empty sheet in set row/col

This commit is contained in:
jhoneill
2018-10-24 17:45:51 +01:00
parent 2c062a4e5d
commit 04e8faaccc
2 changed files with 2 additions and 0 deletions

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