❀❀❀Excel加载项开发及发布❀❀❀

❀❀❀Excel加载项开发及发布❀❀❀,第1张

✅✅ 使用Visual Studio 2019 进行excel加载项开发:

1、​🌾​🌾新建项目

​⚠️​⚠️如果没有此功能,安装即可​⚠️​⚠️。

2、🌸🌸F5/启动,即可在excel里面看到任务窗格。

manifest清单详解:


<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>eca64a51-6626-4b0b-8754-72ae5f888321Id>

  
  <Version>1.0.0.0Version>
  <ProviderName>[提供程序名称]ProviderName>
  <DefaultLocale>en-USDefaultLocale>
  
  <DisplayName DefaultValue="KL_小助手" />
  <Description DefaultValue="ExcelWebAddIn1"/>
  
  <IconUrl DefaultValue="~remoteAppUrl/Images/Button32x32.png" />

  <SupportUrl DefaultValue="http://www.contoso.com" />
  
  <AppDomains>
    <AppDomain>AppDomain1AppDomain>
    <AppDomain>AppDomain2AppDomain>
    <AppDomain>AppDomain3AppDomain>
  AppDomains>
  

  
  <Hosts>
    <Host Name="Workbook" />
  Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="~remoteAppUrl/Home.html" />
  DefaultSettings>
  

  <Permissions>ReadWriteDocumentPermissions>

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

    
    <Hosts>
      
      
      
      <Host xsi:type="Workbook">
        
        <DesktopFormFactor>
          
          <GetStarted>
            
            <Title resid="Contoso.GetStarted.Title"/>

            
            <Description resid="Contoso.GetStarted.Description"/>

            
            <LearnMoreUrl resid="Contoso.GetStarted.LearnMoreUrl"/>
          GetStarted>
          
          <FunctionFile resid="Contoso.DesktopFunctionFile.Url" />

          
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            
            <OfficeTab id="TabHome">
              
              <Group id="Contoso.Group1">
                
                <Label resid="Contoso.Group1Label" />
                
                
                <Icon>
                  <bt:Image size="16" resid="Contoso.tpicon_16x16" />
                  <bt:Image size="32" resid="Contoso.tpicon_32x32" />
                  <bt:Image size="80" resid="Contoso.tpicon_80x80" />
                Icon>
      
                

                
                <Control xsi:type="Menu" id="Contoso.Menu">
                  <Label resid="Contoso.Dropdown.Label" />
                  <Supertip>
                    <Title resid="Contoso.Dropdown.Label" />
                    <Description resid="Contoso.Dropdown.Tooltip" />
                  Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Contoso.tpicon_16x16" />
                    <bt:Image size="32" resid="Contoso.tpicon_32x32" />
                    <bt:Image size="80" resid="Contoso.tpicon_80x80" />
                  Icon>
                  <Items>

                    <Item id="Contoso.Menu.Item2">
                      <Label resid="Contoso.Item2.Label"/>
                      <Supertip>
                        <Title resid="Contoso.Item2.Label" />
                        <Description resid="Contoso.Item2.Tooltip" />
                      Supertip>
                      <Icon>
                        <bt:Image size="16" resid="Contoso.tpicon_16x16" />
                        <bt:Image size="32" resid="Contoso.tpicon_32x32" />
                        <bt:Image size="80" resid="Contoso.tpicon_80x80" />
                      Icon>
                      <Action xsi:type="ShowTaskpane">
                        <TaskpaneId>MyTaskPaneID2TaskpaneId>
                        <SourceLocation resid="Contoso.Toggle.Url" />
                      Action>
                    Item>
                    <Item id="Contoso.Menu.Item1">
                      <Label resid="Contoso.Item1.Label"/>
                      <Supertip>
                        <Title resid="Contoso.Item1.Label" />
                        <Description resid="Contoso.Item1.Tooltip" />
                      Supertip>
                      <Icon>
                        <bt:Image size="16" resid="Contoso.tpicon_16x16" />
                        <bt:Image size="32" resid="Contoso.tpicon_32x32" />
                        <bt:Image size="80" resid="Contoso.tpicon_80x80" />
                      Icon>
                      <Action xsi:type="ShowTaskpane">
                        <TaskpaneId>MyTaskPaneID1TaskpaneId>
                        <SourceLocation resid="Contoso.Taskpane.Url" />
                      Action>
                    Item>


                  Items>
                Control>
                
              Group>
            OfficeTab>
          ExtensionPoint>
        DesktopFormFactor>
      Host>
    Hosts>

    
    <Resources>
      <bt:Images>
        <bt:Image id="Contoso.tpicon_16x16" DefaultValue="~remoteAppUrl/Images/Button16x16.png" />
        <bt:Image id="Contoso.tpicon_32x32" DefaultValue="~remoteAppUrl/Images/Button32x32.png" />
        <bt:Image id="Contoso.tpicon_80x80" DefaultValue="~remoteAppUrl/Images/Button80x80.png" />
      bt:Images>
      <bt:Urls>
        <bt:Url id="Contoso.DesktopFunctionFile.Url" DefaultValue="~remoteAppUrl/Functions/FunctionFile.html" />
        <bt:Url id="Contoso.Taskpane.Url" DefaultValue="~remoteAppUrl/Home.html" />
        <bt:Url id="Contoso.Toggle.Url" DefaultValue="~remoteAppUrl/toggle.html" />
        <bt:Url id="Contoso.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
      bt:Urls>
      
      <bt:ShortStrings>
        <bt:String id="Contoso.TaskpaneButton.Label" DefaultValue="Show Taskpane" />
        <bt:String id="Contoso.Group1Label" DefaultValue="Commands Group" />
        <bt:String id="Contoso.GetStarted.Title" DefaultValue="Get started with your sample add-in!" />
        <bt:String id="Contoso.Dropdown.Label"
           DefaultValue="KL_Excel助手" />
        <bt:String id="Contoso.Item1.Label"
                   DefaultValue="KL-AMAT相关查询" />
        <bt:String id="Contoso.Item2.Label"
                   DefaultValue="物料专案相关" />
      bt:ShortStrings>
      
      <bt:LongStrings>
        <bt:String id="Contoso.TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane" />
        <bt:String id="Contoso.GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started." />
        <bt:String id="Contoso.Dropdown.Tooltip"
             DefaultValue="Click to Show Options on this Menu" />
        <bt:String id="Contoso.Item1.Tooltip"
                   DefaultValue="Click to Show Taskpane1" />
        <bt:String id="Contoso.Item2.Tooltip"
                   DefaultValue="Click to Show Taskpane2" />
      bt:LongStrings>
    Resources>
  VersionOverrides>
  

OfficeApp>

🌴🌴加载项发布步骤:🌴🌴

🔵1、在visual studio 2019工具栏 生成选项卡-------->发布 :选择IIS发布------>Web Deploy包,选择位置,填写站点名称。
🔵2、保存-------->发布。发布成功后会在本地文件夹生成一个zip包,复制到服务器上。
🔵3、登录到服务器,点击右上方工具,第一个选项IIS管理器,在Default Web Site 上右击选择部署,导入从本地复制过来的zip包,即 可看到站点名为excal.add.ins的应用程序。
🔵4、修改Manifest.xml文件: 此文件应该在[projectUrl]\bin\Debug\OfficeAppManifests目录下找到。
把文件夹中的~remoteAppUrl一键替换为服务器地址+站点名称。
🔵5、把Manifest.xml文件存放到指定位置。


💁‍♂💁‍♂如何应用加载项:

⭐️复制Manifest.xml文件所在路径,在打开的excel文件中,把所在文件加入到信任中心
⭐️打开开发工具,点击加载项—>共享文件夹即可看到开发的加载项,添加即可。
⭐️信任中心和开发工具均在文件---->选项

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/722489.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-26
下一篇 2022-04-26

发表评论

登录后才能评论

评论列表(0条)

保存