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

Is there a way to freeze top rows and/or column after a bunch of Set-ExcelRange calls? #1614

Open
kwein123 opened this issue Jun 27, 2024 · 1 comment

Comments

@kwein123
Copy link

Pardon me if my code style is backwards from Doug's examples. In my work, I create a custom spreadsheet from various data.
After all that formatting, I would like to freeze the top two rows and first column. But if I try something like this, it errors out:

Set-ExcelRange -Worksheet $Worksheet -Address $Range -FreezeTopRow

If I try something like this at the end of my script, it doesn't error, but doesn't do anything helpful, either:

Export-Excel -ExcelPackage $Excel -FreezeTopRow
@dfinke
Copy link
Owner

dfinke commented Jun 28, 2024

@kwein123 thanks for using ImportExcel.

Not backwards at all. That would be a good guess and I didn't implement it that way, (unfortunately?)

You need to grab the the worksheet and then: $ws.View.FreezePanes(3, 2)

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

2 participants