0

I'm trying to develop a excel add-in that will have mainly custom-functions that will read data from a socket-server and publish then Real time to excel cells.

The add-in requires authentication and it is implemented using a OfficeDialog and auth0 service..

The problem is that my add-in will use the socketcluster-client and when I instantiate the client in my functions.js, like this:


const SocketClusterClient = require("socketcluster-client");

let socket = SocketClusterClient.create({
  hostname: "localhost",
  port: 443,
  path: "/excel/"
});

The add-in stops to work on excel desktop, but still works on excel web. I can see the excel-web logging in to my socket-cluster server. so the problem is with the desktop version of the excel.

Can someone help me with this?

My first socket-cluster client uses async/wait my first thought was that, as the custom function runs in a different runtime than the rest of the office-js, this runtime might not support this feature, but i tried to make everything tun on the shared runtime with no success.

Any advices are very appreciated, as this is all new to me and i'm really having a tuff time trying to implement this.

Thanks

The site for the socket-cluster is https://socketcluster.io/

1 Answers1

0

It is probably better not to use “localhost” but to instead use the actual server domain name. This might also require updating the manifest to include the domain in the list of allowed domains.

For debug purpose, you may can try followings:

  1. Find HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\WEF\Developer\<solutionId>,
  2. Add below value

enter image description here

xiaochun
  • 114
  • 5
  • Thanks for your repsonse. I'm going to change from localhost to the final domain as soon as my addin is working. The issue is not with the localhost now because i can use it on the web version...Also, all my sollutions alread have this key:value on the register... Thanks again – Gustavo Jacob May 19 '20 at 14:39
  • Sorry to hear that the solution does not work for you. Is there any error you may notice when you operate the websocket, such as open the websocket, send data to the websocket, etc? – xiaochun May 20 '20 at 00:39
  • No errors what so ever! It's been very hard for me to debug the add in while running it on the desktop, and the problem right now happen only on the desktop! – Gustavo Jacob May 20 '20 at 08:16
  • Have you tried [enable runtime logging](https://learn.microsoft.com/en-us/office/dev/add-ins/testing/runtime-logging)? For desktop please refer to the section "Runtime logging on Windows". Runtime logging delivers console.log statements to a separate log file you create to help you uncover issues. – xiaochun May 20 '20 at 15:24
  • I have used it before but to handle manifest issues.. it will log to theis file if i issue a console.log() on my js? Thanks for your help on this issue!! – Gustavo Jacob May 20 '20 at 19:35
  • Ya. I think so. You can use console.log() to uncover the issue. – xiaochun May 21 '20 at 16:29