Appending to a Table corrupts the table when using a Title
Closed this issue · 2 comments
I've been trying to append a list of objects to a table:
$list1= @( [pscustomobject] @{ name = "bob"; age = 10}, [pscustomobject]@{ name = "alice"; age = 20} )
$list2 = @( [pscustomobject] @{ name = "foo"; age = 30}, [pscustomobject]@{ name = "bar"; age = 40} )
Export-Excel -Path no_title.xlsx -InputObject $list1 -WorksheetName friends -Append -TableName tbl_friends -AutoSize
Export-Excel -Path no_title.xlsx -InputObject $list2 -WorksheetName friends -Append -TableName tbl_friends -AutoSize
The result file is correct and as expected. I can iterate 100 times, it remains perfect.
But if I use a title:
$list1= @( [pscustomobject] @{ name = "bob"; age = 10}, [pscustomobject]@{ name = "alice"; age = 20} )
$list2 = @( [pscustomobject] @{ name = "foo"; age = 30}, [pscustomobject]@{ name = "bar"; age = 40} )
Export-Excel -Path with_title.xlsx -InputObject $list1 -WorksheetName friends -Append -TableName tbl_friends -AutoSize -Title "My Friends"
Export-Excel -Path with_title.xlsx -InputObject $list2 -WorksheetName friends -Append -TableName tbl_friends -AutoSize -Title "My Friends"
WARNING: -Title Parameter is ignored when appending. # <- very nice !
The result is corrupted:
Sorry I have a french edition
NB. The first run is correct:
Maybe I don't do it the right way? Or I should insert a new line between title and table (which I don't know how to do).
Thanks for this great project (and specially with dealing with tables).
ImportExcel : 7.8.10
PowerShell: 7.5.0 on Windows-10
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.
Hi,
really? this issue won't be fixed? I've found this issue pretty annoying, but nobody has time to do everything!
thanks again for this project!


