OfficeDev / generator-office

Yeoman generator for building Microsoft Office related projects.
https://www.npmjs.com/package/generator-office
MIT License
818 stars 207 forks source link

Unable to see User Defined Functions #744

Closed b0arderman closed 1 year ago

b0arderman commented 1 year ago

Expected behavior

Ability to utilize a function that is defined in functions.js in Excel once it is loaded.

Current behavior

The sidebar task pane loads, but the user defined functions are not available.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Followed the instructions at: https://github.com/OfficeDev/generator-office
  2. I modified the instructions above to use the following command to generate the office plugin: yo office --projectType excel-functions --name "mb_ns_excel_connector4" --host excel --js true
  3. Ran npm run build
  4. Ran npm start and tried npm start:desktop

Excel opens after the above and I can see the task pane. It appears to work and when I click run it highlights the cell in yellow. When I try to access any of the functions can't find them. I've tried the following:

=add( =contoso.add( =myfunctions.add( =mb_ns_excel_connector4.add(

Context

I am using Excel with Office 365 desktop version.

Below is the manifest.xml: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

0a665989-ca49-4726-98f7-eef4042e90c5 1.0.0.0 Contoso en-US https://www.contoso.com ReadWriteDocument <Description resid="GetStarted.Description"/> <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/> </GetStarted> <FunctionFile resid="Commands.Url"/> <ExtensionPoint xsi:type="PrimaryCommandSurface"> <OfficeTab id="TabHome"> <Group id="CommandsGroup"> <Label resid="CommandsGroup.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="TaskpaneButton"> <Label resid="TaskpaneButton.Label"/> <Supertip> <Title resid="TaskpaneButton.Label"/> <Description resid="TaskpaneButton.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="ShowTaskpane"> <TaskpaneId>ButtonId1</TaskpaneId> <SourceLocation resid="Taskpane.Url"/> </Action> </Control> </Group> </OfficeTab> </ExtensionPoint> </DesktopFormFactor> </Host> </Hosts> <Resources> <bt:Images> <bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon-16.png"/> <bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon-32.png"/> <bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/> </bt:Images> <bt:Urls> <bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/dist/functions.js"/> <bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/dist/functions.json"/> <bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3000/dist/functions.html"/> <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/> <bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/> <bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/> </bt:Urls> <bt:ShortStrings> <bt:String id="Functions.Namespace" DefaultValue="CONTOSO"/> <bt:String id="GetStarted.Title" DefaultValue="Get started with your sample add-in!"/> <bt:String id="CommandsGroup.Label" DefaultValue="Commands Group"/> <bt:String id="TaskpaneButton.Label" DefaultValue="Show Taskpane"/> </bt:ShortStrings> <bt:LongStrings> <bt:String id="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="TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane"/> </bt:LongStrings> </Resources> </VersionOverrides> </OfficeApp> <h2>Failure Logs</h2> <p>Please include any relevant log snippets, screenshots or code samples here.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/millerds"><img src="https://avatars.githubusercontent.com/u/10135066?v=4" />millerds</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>First thing to try is clearing the cache: <a href="https://learn.microsoft.com/en-us/office/dev/add-ins/testing/clear-cache">https://learn.microsoft.com/en-us/office/dev/add-ins/testing/clear-cache</a> If that doesn't work, try using runtime logging to get more information about the failure to load the functions: <a href="https://learn.microsoft.com/en-us/office/dev/add-ins/testing/runtime-logging">https://learn.microsoft.com/en-us/office/dev/add-ins/testing/runtime-logging</a></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/b0arderman"><img src="https://avatars.githubusercontent.com/u/67908609?v=4" />b0arderman</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>Thanks so much for the quick response! I cleared the cache and opened a new project and it is working now. Thank you. I am still unable to debug a user defined function or see results from the debugger. I've tried several different methods over the past few hours. Should I open a new issue for this?<br /> I've tried using the following command: npx office-addin-debugging start .\manifest.xml</p> <p>I've also tried using the following in the launch.json with the native debugger: "configurations": [ { "name": "Excel Desktop (Custom Functions)", "type": "node", "request": "attach", "port": 9229, "timeout": 600000, "preLaunchTask": "Debug: Excel Desktop", "postDebugTask": "Stop Debug", "resolveSourceMapLocations": null }... ]</p> <p>The debugger appears to connect to VS Code, but I'm not seeing any output from console.log. Thanks, Eric</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/millerds"><img src="https://avatars.githubusercontent.com/u/10135066?v=4" />millerds</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>This is actually a known issue that happened not too long ago that we are still trying to figure out.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/b0arderman"><img src="https://avatars.githubusercontent.com/u/67908609?v=4" />b0arderman</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>Ok, thanks. Are there any suggested work arounds, would you recommend temporarily using the sidebar as a log or another logging method other than console.log? Thanks, Eric</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/millerds"><img src="https://avatars.githubusercontent.com/u/10135066?v=4" />millerds</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>I don't have a good workaround right now. You could use if blocks and returning a message which will get written in the cell using the function. I'm not sure if it's possible to modify other cells from within a function if you want to output a series of output statements rather than a single message. These may or may not work for you.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/b0arderman"><img src="https://avatars.githubusercontent.com/u/67908609?v=4" />b0arderman</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>Those are some greats thoughts. Thank you!</p> <p>On Thu, Nov 17, 2022 at 3:27 PM Darren Miller <strong><em>@</em></strong>.***> wrote:</p> <blockquote> <p>I don't have a good workaround right now. You could use if blocks and returning a message which will get written in the cell using the function. I'm not sure if it's possible to modify other cells from within a function if you want to output a series of output statements rather than a single message. These may or may not work for you.</p> <p>— Reply to this email directly, view it on GitHub <a href="https://github.com/OfficeDev/generator-office/issues/744#issuecomment-1319226457">https://github.com/OfficeDev/generator-office/issues/744#issuecomment-1319226457</a>, or unsubscribe <a href="https://github.com/notifications/unsubscribe-auth/AQGDIANMG2EKEXTLCU3SPPTWI2PL7ANCNFSM6AAAAAASDPNMTU">https://github.com/notifications/unsubscribe-auth/AQGDIANMG2EKEXTLCU3SPPTWI2PL7ANCNFSM6AAAAAASDPNMTU</a> . You are receiving this because you authored the thread.Message ID: <strong><em>@</em></strong>.***></p> </blockquote> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/gendev1"><img src="https://avatars.githubusercontent.com/u/116616918?v=4" />gendev1</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>I am also getting the same issue,is it resolved? I am doing this on Mac and Web</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>