mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Merge pull request #1273 from steve-daedilus/master
Set Validate Range for rows to max rows available
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
[Parameter(ParameterSetName = 'PackageC', Mandatory)]
|
||||
[Switch]$NoHeader ,
|
||||
[Alias('HeaderRow', 'TopRow')]
|
||||
[ValidateRange(1, 9999)]
|
||||
[ValidateRange(1, 1048576)]
|
||||
[Int]$StartRow = 1,
|
||||
[Alias('StopRow', 'BottomRow')]
|
||||
[Int]$EndRow ,
|
||||
|
||||
@@ -32,6 +32,12 @@ Describe 'Test' -Tag ImportExcelEndRowAndCols {
|
||||
$colNames[0] | Should -Be 'Units'
|
||||
$colNames[1] | Should -Be 'Price'
|
||||
}
|
||||
|
||||
It 'Should read any row up to maximum allowed row' {
|
||||
$xlMaxRows = "$PSScriptRoot\MaxRows.xlsx"
|
||||
$actual = Import-Excel $xlMaxRows -StartRow 1048576 -EndRow 1048576 -NoHeader
|
||||
$actual.P1 | Should -Be 1048576
|
||||
}
|
||||
}
|
||||
|
||||
Context 'Test reading multiple sheets with data in differnt rows and columns' {
|
||||
|
||||
BIN
__tests__/ImportExcelTests/MaxRows.xlsx
Normal file
BIN
__tests__/ImportExcelTests/MaxRows.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user