Excel-DNA/Excel-DNA — pull request #1 by bpatra (2014-08-26 16:08:09+00:00)
Title: CommandBar by ID

There are two CommandBar with name "Cell": one for the usual right click on a cell and one for the "PageBreakView" [see this article](http://msdn.microsoft.com/en-us/library/office/gg469862(v=office.14).aspx). 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.

"