2

According to the API docs, the Office.Settings objects are saved per add-in and per document. That is, they are available only to the add-in that created them, and only from the document in which they are saved.

I'm a bit confused regarding the Office.Settings interface. I've created a gist in the ScriptLab Add-in where I set 2 setting objects (queries and queryIDs) and then retrieve them (log them to console).

Gist: https://gist.github.com/VivianVenter/e5489628384f96f2d3bf9a50aace8728

If I run this gist on Excel Desktop, then I can create the settings and retrieve them successfully. If I save this workbook and open it in Excel Online and run the gist again then I cannot retrieve the settings, it returns null for both settings object.

According to my knowledge the ScriptLab Add-in is the same for the Desktop and Online version, am I missing something, or is it the intention of OfficeJS to not make the settings available/visible in the Online version if it was created and set in the Desktop version?

Settings desktop found: The settings objects was found in Excel Desktop

Settings online null: The settings objects was NOT found in Excel Online

VivSter2.0
  • 23
  • 1
  • 5

2 Answers2

1

Office add-in's setting is stored based on the add-in's id. And once it is installed by side-loading, a new id is allocated to the add-in every time. This means you can't sync settings on multiple platforms while developing.

Once you submitted the add-in to the AppSource, a static id from AppSource is allocated to the add-in and it is used while installing the add-in from AppSource.

So, you should submit the add-in to AppSource to test/implement this feature.

robdev91
  • 1,006
  • 1
  • 10
  • 18
  • I completely understand your reasoning above, however, ScriptLab is an app in the store so it should have a static id from my understanding and it is not sideloaded during the tests mentioned above – VivSter2.0 Jan 15 '21 at 06:55
0

The issue was caused by a bug in office-js which has now been fixed upstream.

Baum mit Augen
  • 49,044
  • 25
  • 144
  • 182
VivSter2.0
  • 23
  • 1
  • 5