Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After import empty rows are getting processed #35

Open
Paul-dH opened this issue Jul 28, 2016 · 0 comments
Open

After import empty rows are getting processed #35

Paul-dH opened this issue Jul 28, 2016 · 0 comments

Comments

@Paul-dH
Copy link

Paul-dH commented Jul 28, 2016

Hi,

If I import a sheet, and the sheet has been edited (removed a lot of rows, now 30). The count of the rows stays the same as the original (600 lines). The lines are empty and give all sorts of errors.

$Users = Import-XLSX -Path "D:\ImportUsers\Import\ImportUsers.xlsx" -Header LastName, FirstName, DisplayName, UserName, UPN, Groups Write-Host "Number of users: $($Users.Count)" #(shows 600, should be 30)

I've tried to use a check for empty values, but this doesn't help.
$Usercount = 0 Foreach ($User in $Users) {If ($User.Username -or ($User.Username -ne "")) {$Usercount++}}

How can I show the correct number of rows. My workarround is to create a new sheet in the workbook, copy all the content I want and delete the old Sheet.

Thanks for the great efford, the module has saved us a lot of manual work and installations of Office on servers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant