https://github.com/OfficeDev/office-js/issues/3486
Will CustomFunctionManager be supported officially? · Issue #3486 · OfficeDev/office-js
Tagging @yaweizhu-henson @Wenjun-Gong @zlatko-michailov (cc @gmichaud) We at Velixo desperately need a way to expose dev / pre-release channels for internal testing, and side-loading just does not ...
github.com
엑셀의 Addin인 Script-Lab이나 Excel-Labs에서 Custom functions을 작성하고 나면 바로 등록해서 사용가능합니다. 이를 위에 언급한 'CFManager'라고 지칭하는 듯 합니다.
Script Lab의 깃허브 소스코드를 보면 이것이 구현되어 있기는 하지만 어려워서 활용을 못해봤는데 이것이 가능하다면 다른 Office Addins을 개발할 때 참 편리할 것입니다. 필요에 따라 사용자가 추가한 기능을 바로 적용할 수 있을 테니깐요.
하지만 현재까지도 제공이 되지 않는 듯하니 조금 더 기다려보면 좋은 소식이 들려오지 않을까 기대해 봅니다.
xlwings 개발자가 새로운 방법에 대해서 포스팅 했습니다.
https://github.com/xlwings/xlwings-server/issues/48
Reload custom function without Excel restart · Issue #48 · xlwings/xlwings-server
On macOS it's enough to just click on the add-in to reload the add-in, but on Windows this freezes Excel, so a restart is required. See OfficeDev/office-js#3486 https://stackoverflow.com/questions/...
github.com
On macOS it's enough to just click on the add-in to reload the add-in, but on Windows this freezes Excel, so a restart is required.
See
- Will CustomFunctionManager be supported officially? OfficeDev/office-js#3486
- https://stackoverflow.com/questions/66875534/what-is-the-process-involved-in-registering-custom-functions-at-runtime
In ScriptLab it's solved like this:
export async function registerCustomFunctions(
functions: Array<ICustomFunctionParseResult<IFunction>>,
code: string,
options: object,
): Promise<void> {
const jsonMetadataString = getJsonMetadataString(functions, options);
if (Office.context.requirements.isSetSupported('CustomFunctions', 1.6)) {
await (Excel as any).CustomFunctionManager.register(jsonMetadataString, code);
} else {
await Excel.run(async context => {
if (Office.context.platform === Office.PlatformType.OfficeOnline) {
const namespace = getScriptLabTopLevelNamespace().toUpperCase();
(context.workbook as any).registerCustomFunctions(
namespace,
jsonMetadataString,
'' /*addinId*/,
'en-us',
namespace,
);
} else {
(Excel as any).CustomFunctionManager.newObject(context).register(
jsonMetadataString,
code,
);
}
await context.sync();
});
}
}
__