Reputation: 31
I'm trying to use the "Shared Runtime" to work with my Excel JS Add-In, but it's not working. Below are the docs that I have been reviewing. Below are screenshots of my project. It looks like I'm able to set an initial state but my custom function is not updating window.sharedState. I also tried using the Excel context object but that is not working either.
My Excel Add-In Project (screenshot #1)
My Excel Add-In manifest.xml file (screenshot #2)
Upvotes: 2
Views: 1492
Reputation: 401
Thanks for sharing the key parts of your project! Your screenshots are very helpful!
The fact that your custom function can read the shared state is a good sign.
The reason why your custom function is not changing the shared state may be because you are not providing a valid JSON. I see several problems with the values you are trying to set:
{ ... }
must be a literal, i.e. you cannot use variables inside. Thus, things like { oldVal: originalVal }
are not valid. If you want to use variables, you'll have to programmatically assign those values, e.g.window.sharedState.test = {};
window.sharedState.test.oldVal = originalVal;
{ first, second }
is not valid - it doesn't adhere to the property: value
pattern.{ "something": 42 }
.Upvotes: 2