Reliably Clear Desktop Excel Addin Cache During Dev

T.J. Crowder 1 Reputation point
2022-04-05T17:01:24.38+00:00

I'm struggling to work on a custom functions Office JS addin because Desktop Excel keeps using old copies of the files. (I am, of course, stuck working on a Desktop-specific bug.)

  • I've cleared %LOCALAPPDATA%\Microsoft\Office\16.0\Wef.
  • I've cleared browser cache (though Excel is using slightly different version of Edge than my browser version, v100 instead of v99).

How do I get Desktop Excel to reliably load up-to-date files?

To give you an idea, I've done this sequence repeatedly:

  1. Change main.html to have an observable side effect (requesting a server resource with name "A" for instance).
  2. Eventually got to the point where Excel was using that version of the file.
  3. Changed the file to show a different side effect (requesting "A2" instead).
  4. Closed Excel
  5. Cleared Wef
  6. Cleared browser cache (though again, not clear it's the same one)
  7. Ran the addin
  8. Saw it run the old file
  9. Opened devtools (this addin has a taskpane, so right-click and choose Inspect)
  10. Do fetch("/main.html").then(r => r.text()).then(console.log) and see the updated version of main.html (so, if it's browser cache, it's been updated)
  11. Close Excel
  12. Stop and restart the web server (to clear its cache; it's really basic, only has memory cache)
  13. Open Excel, run the addin, and still see the old side-effect (even though the web server shows a get for main.html)
  14. Repeating the fetch thing gets the latest version; not a browser or server caching issue. It's Excel itself.

This seems really basic and fundamental: Load the latest version of the resource. What am I missing?

Thanks,

-- T.J.

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
915 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,663 questions
{count} votes