I want to try execute this function for Office API for JavaScript:
public loadCustomProperties() {
Excel.run(async (ctx) => {
let custom = ctx.workbook.properties.custom;
custom.load();
return ctx.sync();
})
}
But I got an error ERROR Error: Uncaught (in promise): GeneralException: An internal error occurred...
(nothing specific)
When I'm trying to load properties
instead of properties.custom
everything works fine.
Please help :)
EDIT:
This is the error I get:
ERROR Error: Uncaught (in promise): GeneralException: An internal error occurred while processing the request. RichApi.Error: An internal error occurred while processing the request. at new r (excel-web-16.00.js:21) at t.c.processRequestExecutorResponseMessage (excel-web-16.00.js:21) at excel-web-16.00.js:21 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388) at Object.onInvoke (core.js:3760) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138) at zone.js:872 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:3751) at new r (excel-web-16.00.js:21) at t.c.processRequestExecutorResponseMessage (excel-web-16.00.js:21) at excel-web-16.00.js:21 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388) at Object.onInvoke (core.js:3760) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138) at zone.js:872 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:3751) at resolvePromise (zone.js:814) at zone.js:724 at rejected (main.js:103) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388) at Object.onInvoke (core.js:3760) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138) at zone.js:872 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:3751)
EDIT 2:
I found this is a known bug: https://github.com/OfficeDev/office-js/issues/179
ctx.sync()
so at this moment it doesn't matter what I do withcustom
because afterctx.sync()
it breaks. – Marcin Szałek