There was the task of generating an xlsx file with a small report, in which there are charts. Drawing them on the go with the functions of this library seemed to me an irrational solution. So I decided to create a template file in which I created all the necessary diagrams and charts. Selected cells to which they were attached. The calculation was that I programmatically changed the values of these cells and gave them to the site user on the fly.
This scheme seems to work. But there is one trouble. When the user loads the file and opens it, the opening takes place in protected mode, in which these cells for some reason remain the same as they were in the template. And only after I allow editing, the cells change as needed and the diagrams take their proper form.
Is it possible to somehow in a template or programmatically prohibit opening an Excel file in protected mode? Or, maybe, you will prompt some other solutions?