mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Trap set row and column on empty shet
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -2,6 +2,8 @@
|
|||||||
Thumbs.db
|
Thumbs.db
|
||||||
ehthumbs.db
|
ehthumbs.db
|
||||||
|
|
||||||
|
*.gitignore
|
||||||
|
|
||||||
# Folder config file
|
# Folder config file
|
||||||
Desktop.ini
|
Desktop.ini
|
||||||
|
|
||||||
@@ -14,6 +16,8 @@ $RECYCLE.BIN/
|
|||||||
*.msm
|
*.msm
|
||||||
*.msp
|
*.msp
|
||||||
|
|
||||||
|
*.dll
|
||||||
|
|
||||||
# Windows shortcuts
|
# Windows shortcuts
|
||||||
*.lnk
|
*.lnk
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,7 @@
|
|||||||
$endRow = $Worksheet.Dimension.End.Row
|
$endRow = $Worksheet.Dimension.End.Row
|
||||||
}
|
}
|
||||||
process {
|
process {
|
||||||
|
if ($null -eq $workSheet.Dimension) {Write-Warning "Can't format an empty worksheet."; return}
|
||||||
if ($Column -eq 0 ) {$Column = $endColumn + 1 }
|
if ($Column -eq 0 ) {$Column = $endColumn + 1 }
|
||||||
$columnName = [OfficeOpenXml.ExcelCellAddress]::new(1,$column).Address -replace "1",""
|
$columnName = [OfficeOpenXml.ExcelCellAddress]::new(1,$column).Address -replace "1",""
|
||||||
Write-Verbose -Message "Updating Column $columnName"
|
Write-Verbose -Message "Updating Column $columnName"
|
||||||
|
|||||||
@@ -126,6 +126,7 @@
|
|||||||
$endRow = $Worksheet.Dimension.End.Row
|
$endRow = $Worksheet.Dimension.End.Row
|
||||||
}
|
}
|
||||||
process {
|
process {
|
||||||
|
if ($null -eq $workSheet.Dimension) {Write-Warning "Can't format an empty worksheet."; return}
|
||||||
if ($Row -eq 0 ) {$Row = $endRow + 1 }
|
if ($Row -eq 0 ) {$Row = $endRow + 1 }
|
||||||
Write-Verbose -Message "Updating Row $Row"
|
Write-Verbose -Message "Updating Row $Row"
|
||||||
#Add a row label
|
#Add a row label
|
||||||
|
|||||||
BIN
__tests__/AllFour.xlsx
Normal file
BIN
__tests__/AllFour.xlsx
Normal file
Binary file not shown.
BIN
__tests__/PS5-And-4.0.5.0.xlsx
Normal file
BIN
__tests__/PS5-And-4.0.5.0.xlsx
Normal file
Binary file not shown.
BIN
__tests__/PS5-And-4.5.2.1.xlsx
Normal file
BIN
__tests__/PS5-And-4.5.2.1.xlsx
Normal file
Binary file not shown.
BIN
__tests__/PS6-And-4.0.5.0.xlsx
Normal file
BIN
__tests__/PS6-And-4.0.5.0.xlsx
Normal file
Binary file not shown.
BIN
__tests__/PS6-And-4.5.2.1.xlsx
Normal file
BIN
__tests__/PS6-And-4.5.2.1.xlsx
Normal file
Binary file not shown.
BIN
__tests__/Test Summary.xlsx
Normal file
BIN
__tests__/Test Summary.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user