Open signax opened 4 months ago
Hi @signax ,
I can't reproduce your issue in a new version excel which is "17425.20110". Could you please just update your excel and try again?
Hi @penglongzhaochina ,
unfortunately I can't, it seems like I'm up to date on office 365.
Build "17328.20184" appears to be the latest release https://learn.microsoft.com/en-us/officeupdates/update-history-microsoft365-apps-by-date
@penglongzhaochina, could you help check again? Thanks!
hi @signax ,
you can get that build now.
hi @penglongzhaochina ,
I checked with build 17245.20176
, but it doesn't work as expected.
The code is the following:
async function freezeColumn() {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
sheet.freezePanes.freezeColumns(1);
await context.sync();
});
}
The first time I invoke the method on a sheet with 2 hidden columns, it doesn't work as expected, the second time it does.
I tried to reproduce the problem with an higher number of frozen columns, e.g. 4.
Hi , I still can't reproduce your case. This the screen shot. As you can see, I hided the 'C' and 'D' columns, and run your code, looks like all works well. You can see a line appear there between column 'B' and 'E'.
Hi @penglongzhaochina, in my repro steps I hid the first two columns, 'A' and 'B' and froze only one column.
You can see that the first time I call the function, nothing happens.
I expect the function to be idempotent.
I can reproduce now. Thanks for reporting this issue.
It has been put on our backlog<Bug#8933901> for internal track. We will keep track of this issue and let you know if there are any updates.
Hi @signax ,
After some internal investigation I think this is a by-design behavior. When the number of freecolumns <= the number of hidden columns the api will just show a separate line in the right of last hidden column, you can see the line if you unhide the columns. otherwise, you can see the separate line will be added.
Hi @penglongzhaochina , my doubt is about the different behavior when I invoke the method multiple times.
As you can see in my gif:
I would expect an idempotent behavior, so I should not see the line on the second invoke, since the number of freecolumns <= the number of hidden columns.
@signax ,
yes, you are right, I will do some more deep investigation.
When using
Excel.WorksheetFreezePanes.freezeColumns(count)
on a sheet with hidden columns, the first time I invokefreezeColumns(1)
, the method doesn't freeze the first visible column.The second time I invoke the method, it works correctly.
Environment
Expected behavior
freezeColumns(1)
should always freeze the first visible column.Current behavior
The first time the method is invoked, it doesn't freeze the first visible column. The second time it works correctly.
Steps to reproduce
freezeColumns(1)