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

Switch -ClearSheet when exporting Excel with PivotRows #8

Open
ArtieLadie opened this issue May 27, 2015 · 0 comments
Open

Switch -ClearSheet when exporting Excel with PivotRows #8

ArtieLadie opened this issue May 27, 2015 · 0 comments

Comments

@ArtieLadie
Copy link

Tested out code at zPSExcel.Intro.ps1 and added -ClearSheet after every Export-XLSX command.

However, when adding -ClearSheet after

Export-XLSX -Path C:\Temp\Files.xlsx -PivotRows Extension -PivotValues Length -ChartType Pie -ClearSheet

Following errors output:

Add-PivotTable : Skipping existing worksheet 'PivotTable1'
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSExcel\Export-XLSX.ps1:359 char:26

  •             $Excel = Add-PivotTable @Params -Excel $Excel -WorkSheetName $Wo ...
    
  •                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Add-PivotTable

You cannot call a method on a null-valued expression.
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSExcel\Export-XLSX.ps1:374 char:17

  •             $Excel.SaveAs($Path)
    
  •             ~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull
@ArtieLadie ArtieLadie changed the title Switch -ChearSheet when exporting Excel with PivotRows Switch -ClearSheet when exporting Excel with PivotRows May 27, 2015
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