EndRow and EndColumn Parameters Ignored in Import-Excel
The EndRow and EndColumn parameters are ignored in the Import-Excel function because the first mention within said function is hardcoded to set them to 0. This subsequently causes them to be reset to the last row in the dimension.
https://github.com/dfinke/ImportExcel/blob/8bb3d500527808f1d191cc442458ae150cd9d572/Public/Import-Excel.ps1#L135-L145
I believe eliminating lines 137-138 will resolve this issue.
@BinaryWizard904 here is the fix. Be great if you could try it before I publish it to the gallery.
https://github.com/dfinke/ImportExcel/releases/tag/v7.6.0
@dfinke, I've tested 7.6.0 and I can confirm that your fix works when it applies. However, line 137 restricts the fix to situations where a user is retrieving data from one worksheet of one workbook.
Why would you disable these parameters in those situations? I actually have use cases where I have to scrape a large number of files with identical layouts, or a single file with multiple worksheets with the same layout (i.e., a workbook contains a year of data that is split into one worksheet for each month).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.