-
Notifications
You must be signed in to change notification settings - Fork 399
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
Export-Excel -Style work wrong with multiple sheets #1567
Comments
Hello. I performed a test of this today , and I'm observing no issue. Versions used in test :
Code sample:
|
Hello, In your case is working fine because you are exporting the same data with the same range of table, but usually different data is exported with a different range. For example:
In this case the DefaultStyle variable will have the range of the first Export and if the rest of the exports have a higher range, the style will not be applied to all the information.
|
Hi @PakoGomezG
Each range is adjusting to the data, and I would expect same for you.
|
Thanks @PakoGomezG for raising this and @pauljnav for the scenarios. Will keep an eye on this thread. 👀 |
Hello,
If you want to use the same Excel Style in multiple Export-Excel, fails applying the first excel/sheet range afert first execution. For example:
$defaultStyle = New-ExcelStyle -AutoSize -HorizontalAlignment Center
foreach ($sheet in $sheets) {
$data | Export-Excel -Path $excelFile -WorksheetName $sheet -Style $defaultStyle
}
After the first 'Export-Excel', $defaultStyle variable have a range property with the dimension of the sheet.
This occurs in Export-Excel.ps1, line 659
The text was updated successfully, but these errors were encountered: