OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
675 stars 95 forks source link

do not see the ribbon bar buttons for excel add-in #798

Closed shyambhiogade closed 4 years ago

shyambhiogade commented 5 years ago

I am not able to see the custom buttons I have added for my excel addins

Expected Behavior

it should display the custom buttons

Current Behavior

Custom buttons are not displayed, addins is loaded correctly but ribbon bar buttons are not displayed, with the same manifest file, it shows ribbon bar buttons in insight online.

Steps to Reproduce, or Live Example

<?xml version="1.0" encoding="UTF-8"?>
<!--Created:fsdfsdf-->
<OfficeApp
          xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
          xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
          xsi:type="TaskPaneApp"> 
  <Id>someid</Id>

  <Version>1.0.0.0</Version>
  <ProviderName>[Provider name]</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>  
  <DisplayName DefaultValue="Historian Addin" />
  <Description DefaultValue="ExcelWebAddIn1"/>
  <!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
  <IconUrl DefaultValue="~remoteAppUrl/Images/Button32x32.png" />

  <SupportUrl DefaultValue="http://www.aveva.com" /> 
  <AppDomains>
    <AppDomain>AppDomain1</AppDomain>
    <AppDomain>AppDomain2</AppDomain>
    <AppDomain>AppDomain3</AppDomain>
  </AppDomains> 
  <Hosts>
    <Host Name="Workbook" />
  </Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="http://localhost:32569/ExcelAddIn/index.html" />
  </DefaultSettings>

  <Permissions>ReadWriteDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">

    <!-- The Hosts node is required. -->
    <Hosts>
      <!-- Each host can have a different set of commands. -->
      <!-- Excel host is Workbook, Word host is Document, and PowerPoint host is Presentation. -->
      <!-- Make sure the hosts you override match the hosts declared in the top section of the manifest. -->
      <Host xsi:type="Workbook">
        <!-- Form factor. Currently only DesktopFormFactor is supported. -->
        <DesktopFormFactor>
          <!--"This code enables a customizable message to be displayed when the add-in is loaded successfully upon individual install."-->
          <GetStarted>
            <!-- Title of the Getting Started callout. The resid attribute points to a ShortString resource -->
            <Title resid="myapp.GetStarted.Title"/>

            <!-- Description of the Getting Started callout. resid points to a LongString resource -->
            <Description resid="myapp.GetStarted.Description"/>

            <!-- Points to a URL resource which details how the add-in should be used. -->
            <LearnMoreUrl resid="myapp.GetStarted.LearnMoreUrl"/>
          </GetStarted>
          <!-- Function file is a HTML page that includes the JavaScript where functions for ExecuteAction will be called.
            Think of the FunctionFile as the code behind ExecuteFunction. -->
          <FunctionFile resid="myapp.DesktopFunctionFile.Url" />

          <!-- PrimaryCommandSurface is the main Office Ribbon. -->
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <!-- Use OfficeTab to extend an existing Tab. Use CustomTab to create a new tab. -->
            <OfficeTab id="TabHome">
              <!-- Ensure you provide a unique id for the group. Recommendation for any IDs is to namespace using your company name. -->
              <Group id="myapp.Group1">
                <!-- Label for your group. resid must point to a ShortString resource. -->
                <Label resid="myapp.Group1Label" />
                <!-- Icons. Required sizes 16,32,80, optional 20, 24, 40, 48, 64. Strongly recommended to provide all sizes for great UX. -->
                <!-- Use PNG icons. All URLs on the resources section must use HTTPS. -->
                <Icon>
                  <bt:Image size="16" resid="myapp.tpicon_16x16" />
                  <bt:Image size="32" resid="myapp.tpicon_32x32" />
                  <bt:Image size="80" resid="myapp.tpicon_80x80" />
                </Icon>

                <!-- Control. It can be of type "Button" or "Menu". -->
                <Control xsi:type="Button" id="myapp.TaskpaneButton">
                  <Label resid="myapp.TaskpaneButton.Label" />
                  <Supertip>
                    <!-- ToolTip title. resid must point to a ShortString resource. -->
                    <Title resid="myapp.TaskpaneButton.Label" />
                    <!-- ToolTip description. resid must point to a LongString resource. -->
                    <Description resid="myapp.TaskpaneButton.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="myapp.tpicon_16x16" />
                    <bt:Image size="32" resid="myapp.tpicon_32x32" />
                    <bt:Image size="80" resid="myapp.tpicon_80x80" />
                  </Icon>

                  <!-- This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFunction or ShowTaskpane. -->
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ButtonId1</TaskpaneId>
                    <!-- Provide a URL resource id for the location that will be displayed on the task pane. -->
                    <SourceLocation resid="myapp.Taskpane.Url" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <!-- You can use resources across hosts and form factors. -->
    <Resources>
      <bt:Images>
        <bt:Image id="myapp.tpicon_16x16" DefaultValue="http://localhost:32569/ExcelAddIn/assets/Images/addin-16x16.png" />
        <bt:Image id="myapp.tpicon_32x32" DefaultValue="http://localhost:32569/ExcelAddIn/assets/Images/addin-32x32.png" />
        <bt:Image id="myapp.tpicon_80x80" DefaultValue="http://localhost:32569/ExcelAddIn/assets/Images/addin-80x80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="myapp.DesktopFunctionFile.Url" DefaultValue="~remoteAppUrl/Functions/FunctionFile.html" />
        <bt:Url id="myapp.Taskpane.Url" DefaultValue="http://localhost:32569/ExcelAddIn/index.html" />
        <bt:Url id="myapp.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
      </bt:Urls>
      <!-- ShortStrings max characters==125. -->
      <bt:ShortStrings>
        <bt:String id="myapp.TaskpaneButton.Label" DefaultValue="Historian" />
        <bt:String id="myapp.Group1Label" DefaultValue="Historian" />
        <bt:String id="myapp.GetStarted.Title" DefaultValue="Get started with your sample add-in!" />
      </bt:ShortStrings>
      <!-- LongStrings max characters==250. -->
      <bt:LongStrings>
        <bt:String id="myapp.TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane" />
        <bt:String id="myapp.GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started." />
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
  <!-- End Add-in Commands Mode integration. -->

</OfficeApp>

and also

image

Your Environment

Useful logs

shyambhiogade commented 4 years ago

i ran the addin validator tool, and it found the root cause, actually resid length was more than 30, after making it smaller, it started working.