-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
CommandBar by ID #1
Conversation
Thank you - I'll have a look. |
Hi Benoit, |
Hi Govert, Following your comment, and since I had the occasion to work with Benoit, I propose you the following modification to Benoit's code.
Does it look ok to you? Alexandre |
Thanks Alexandre - I think that will be great. |
- Id property part of CommandBarControl - Only CommandBarPopup objects have an Id when looking for CommandBar with a given Id
…into commandBarByID Conflicts: Source/ExcelDna.Integration/ExcelCommandBars.cs
The remote branch commandBarByID benefits from these changes merging the pull request now should take the five commit the last one being made by Alexandre.. |
OK - this is finally integrated. Sorry it took so long - I'm moving the main repository over to GitHub at last. |
There are two CommandBar with name "Cell": one for the usual right click on a cell and one for the "PageBreakView" see this article. When passing to the method ExcelCommandBarUtil.LoadCommandBar an xml argument of the form
the first CommandBar whose name is "Cell" is returned. We have found situations where this first CommandBar is the "Cell" for PageBreakView and not the usual one.
In this pull request we add the possibility to specify the id of the CommandBar to avoid such situations. If an attribute id is present then it will be used to retrieve the CommandBar instead of name. If no id attribute is present then the name is used as a fallback (to avoid breaking existing code). Note that the attribute name is mandatory in both cases.
Now if you want to retrieve the usual "Cell" CommandBar you can use its id 424.