0

I'm trying to build a second tab in my Excel Add-In and I can't get it to work. I've basically duplicated my first tab and if I delete either tab, they show, but I can't get both to show together. Is it possible for an Office Add-In to have more then one tab?

I was reading about <ExtensionPoint xsi:type="PrimaryCommandSurface"> and wondered if that should be duplicated around my custom tabs or if all the tabs should be inside that one element?

Here is my custom tab that is working. If I re-arrange them, the second one will load always.

 <ExtensionPoint xsi:type="PrimaryCommandSurface">

        <!-- Custom Tab -->
        <!-- <OfficeTab id="TabHome"> -->
        <CustomTab id="Contoso.CustomTab2">
          <Group id="Contoso.CustomTab2.group1">

            <Label resid="FindSMP.Label"/>
            <Icon>
              <bt:Image size="16" resid="Icon.16x16"/>
              <bt:Image size="32" resid="Icon.32x32"/>
              <bt:Image size="80" resid="Icon.80x80"/>
            </Icon>

            <Control xsi:type="Button" id="NewButton">
              <Label resid="FakeData.Label"/>
              <Supertip>
                <Title resid="FakeData.Label"/>
                <Description resid="FakeData.Tooltip"/>
              </Supertip>
              <Icon>
                <bt:Image size="16" resid="Icon.16x16"/>
                <bt:Image size="32" resid="Icon.32x32"/>
                <bt:Image size="80" resid="Icon.80x80"/>
              </Icon>
              <Action xsi:type="ExecuteFunction">
                <FunctionName>fakedata</FunctionName>
              </Action>
            </Control>


          </Group>
          <Label resid="TabGroup.Label"/>

        </CustomTab>
        <!-- Custom Tab -->
      </ExtensionPoint>
      <ExtensionPoint xsi:type="PrimaryCommandSurface">
        <!-- Custom Tab -->
        <!-- <OfficeTab id="TabHome"> -->
        <CustomTab id="Contoso.CustomTab3">
          <Group id="Contoso.CustomTab3.group1">

            <Label resid="FindSMP.Label"/>
            <Icon>
              <bt:Image size="16" resid="Icon.16x16"/>
              <bt:Image size="32" resid="Icon.32x32"/>
              <bt:Image size="80" resid="Icon.80x80"/>
            </Icon>

            <Control xsi:type="Button" id="FakeDataButton">
              <Label resid="FakeData.Label"/>
              <Supertip>
                <Title resid="FakeData.Label"/>
                <Description resid="FakeData.Tooltip"/>
              </Supertip>
              <Icon>
                <bt:Image size="16" resid="Icon.16x16"/>
                <bt:Image size="32" resid="Icon.32x32"/>
                <bt:Image size="80" resid="Icon.80x80"/>
              </Icon>
              <Action xsi:type="ExecuteFunction">
                <FunctionName>fakedata</FunctionName>
              </Action>
            </Control>


          </Group>
          <Label resid="TabGroup12.Label"/>

        </CustomTab>
        <!-- Custom Tab -->

      </ExtensionPoint>

If I comment this out, then the first one loads:

  </ExtensionPoint>
  <ExtensionPoint xsi:type="PrimaryCommandSurface">

Update: Issue URL on GitHub --> https://github.com/OfficeDev/office-js/issues/2521

FreeSoftwareServers
  • 2,271
  • 1
  • 33
  • 57
  • 1
    According to the schema at https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-owemxml/82e93ec5-de22-42a8-86e3-353c8336aa40, there is no limit to the number of ``s in an `` and no limit to the number of <`ExtensionPoint>`s in a ``, so both methods should work. If you don't get an answer here in a few days, consider filing an issue with the [office-js repo](https://github.com/OfficeDev/office-js/issues/new/choose). – Rick Kirkham Apr 01 '22 at 20:29
  • Thanks @RickKirkham, I'll have to debug my code, but at least I know it should work. I feel like I debugged this a long time and couldn't get it to work, my plan now is to write an xml for each tab. I believe I tested you can load multiple add-ins from the same network share as I'll be starting w/ sideloading as deployment method. Feel free to write an answer that it should be if you'd like and discuss the `ExtensionPoint`. It seems weird to me that there is no correct/recommended way when it comes to wrapping `CustomTab` inside individual `ExtensionPoint`s or not, but I like flexibility! – FreeSoftwareServers Apr 02 '22 at 08:31
  • Ohh one thing that I still can't figure out that I wonder if is the issue, my icons don't seem to work, it just always loads the same Icons regardless of what's in my manifest, but it works. I also have to test w/ a live Webserver tbh, I've been testing in Visual Studio... – FreeSoftwareServers Apr 02 '22 at 08:33
  • Icons are cached. Try clearing the Office cache. There's an article about doing this in the Office Add-ins documentation. – Rick Kirkham Apr 03 '22 at 02:57
  • Ive cleared WEF, still they don't work, but thats another post sorta, tho possibly related – FreeSoftwareServers Apr 03 '22 at 23:50
  • @RickKirkham issue was non https URLs for Icons FYI. Even though I can't use HTTPS for most things because my project is hosted http, the icons NEED https. But, at least they default to an icon if the URL isn't. I'm going to open a issue on GH now. – FreeSoftwareServers Apr 10 '22 at 02:31
  • @RickKirkham issue for 2x Tabs on Github --> https://github.com/OfficeDev/office-js/issues/2521 . I made a new Template w/ VS and attempted to use that as a base for testing and it still didn't work. – FreeSoftwareServers Apr 10 '22 at 17:27
  • @RickKirkham guess 2x tabs aren't support, got an answer on Github :(. Lame sauce. My current single XLAM Add-In has around 5 tabs for each department and I'm able to have two xlam's share the same tab and define icons via MSO built in Icons not futz w/ needing 3x size Icons and needing HTTPS. – FreeSoftwareServers Apr 13 '22 at 06:40

1 Answers1

0

According to MSFT an Add-In can't have two tabs.

FreeSoftwareServers
  • 2,271
  • 1
  • 33
  • 57