[Asc.plugin.callCommand] is invalid in plugin

I am preparing to load an Excel document containing multiple sheet pages. In the plugin, I wrote the callCommand command in the init method to try to cut the Excel document to the specific sheet index page, but I failed. This code did not take effect. I have looked at the official document example, but I am not sure if it is due to my configuration error or if my community version does not support it. I urgently need your help. Thank you

(function (window, undefined) {
  var AscPlugin = window.Asc.plugin;

  AscPlugin.init = function (initData) {
     Asc.plugin.callCommand(
        () => {
          const targetSheet = Api.GetSheet('sheet2'); 
          targetSheet.SetActive(); // Activate specific sheet pages
        },
        true,
        true,
        (returnValue) => {}
      );
  };
})(window, undefined);

my onlyoffice version: community 8.2.2.22
Doesn’t the community support plugin usage?
Why isn’t this method executed

Hello @hulianzaixian123

Plugins are supported in all versions, however, you are using outdated one. Please update your instance to the actual version 8.3.2 and check the situation again.

UPD: Due to current recalculation logic, setting sheet as active is considered to be a change, but it is not getting rendered automatically after callCommand call. To fix it, please add calculation to the end of callCommand and check if it works for you:

(function (window, undefined) {
  window.Asc.plugin.init = function () {
    Asc.plugin.callCommand(function () {
        const targetSheet = Api.GetSheet("Sheet2");
        targetSheet.SetActive(); // Activate specific sheet pages
        Api.asc_calculate(1);
      }, true, true, (returnValue) => {}
    );
  };
})(window, undefined);

I tried it, but when the Excel document was initially loaded, it still didn’t automatically switch to the specific sheet page, and the asc_calculate method didn’t take effect. Is this method supported in version 8.2? Or what should I do if I want to automatically switch to a specific sheet page after the initial loading of an Excel document? Is there corresponding code support? Thank you

Would you mind sharing your current implementation for better understanding?

UPD: Also, please specify in which product you intend to use the plugin, e.g. Desktop Editors or Document Server.

hello@Constantine ,Thank you for your patience
I just tried it out and the code miraculously worked. It’s strange, thank you very much

1 Like

I am glad to know.