dfinke/ImportExcel

Saving Excel Package

efigueredo opened this issue · 10 comments

I just updated to the latest version of ImportExcel
My script was previously able to save successfully and as of the new update, saving fails.
The lack of detail makes it very hard to troubleshoot what the cause might be.

====
Exception calling "Save" with "0" argument(s): "Error saving file

ImportExcel\7.8.10\Public\Close-ExcelPackage.ps1:29 char:20

  •         else { $ExcelPackage.Save() }
    
  •                ~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : InvalidOperationException
dfinke commented

no idea. if you roll back to the other version, does it work?

dfinke commented

if possible, send me the xlsx. may be possible to import that error message,

maybe this solution will solve your problem click

dfinke commented

can you create an xlsx with 2 sheets, one that is good an the other with the bad formula?

dfinke commented

Thanks for the question @efigueredo.

Is that a pre-existing workbook?

On the Export-Excel there is a switch AutoNameRange that creates names.

I believe I do it at the workbook level.

The $xlValueCell.Formula = “=COUNTA(tblClusters[Cluster])” - iirc there may be addtional syntax to make that work, check the Examples folder in the repo.