Skip to content
Discussion options

You must be logged in to vote

Thanks for trying ImportExcel @Ntinsky.

You need to set the coloring and formatting when you set it back to the xlsx. It does not know abt the template or formatting.

Check out Set-ExcelRange. When you do the Export-Excel you can use -PassThru this lets you do more granular work on the workbook/sheets etc. You need to Close-ExcelPackage to save the changes.

Off the top of my head, may not be 💯

$xlpkg = $data | Export-Excel -PassThru

Set-ExcelRange -Worksheet $xlpkg.Sheet1 -BackgroundColor Yellow -Range "A1"

Close-ExcelPackage $xlpkg 

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Ntinsky
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants