Home > Software engineering >  Embed Excel scripts into the .XLSX file?
Embed Excel scripts into the .XLSX file?

Time:12-18

I know that Excel TypeScript scripts are saved to your OneDrive, and that you can share that script with other members of your organization (though it seems you can only share it with everybody, not specific people).

Is there a way to embed the script into the .xlsx file? So that if I made a copy and gave it to somebody, they could use the scripts too without having to manually import them? I want to bring the script down from the Office Cloud level and store in inside of the workbook, so that I can make copies of the file for other users to own themselves.

I just ran a test- I created a script in an excel file and added a button for it on the page. I closed that excel file, opened another, and deleted the script. Then I went back to the first file, and I couldn't run the script. It seems that, at least by default, they are 100% stored externally from the file.

Is such a thing possible?

CodePudding user response:

Microsoft documentation states that Office Scripts can be opened on Excel for Windows, but as I see on this link it looks like that the same file is opened from different (online/desktop) application, so it looks like that there is no classical download from the cloud on the local machine.

In case that your script is written in VBA, you can try to embed it into Excel file in .xls format, but as you can see on this link, it can be considered as a safety threat, which is one of the reasons why .xlsx format can not contain VBA macros and must be saved as .xlsm, xlam, xlsb...

CodePudding user response:

I don't believe that embedding Office Scripts is supported per this link. You can see an excerpt from that link below (I've bolded certain parts for emphasis):

Office Scripts are stored as .osts files in your Microsoft OneDrive or a SharePoint folder. They are stored separately from a workbook. To give users who are outside of the SharePoint site access to the script, share the script with an Excel workbook. This means you're linking the script with the file, not attaching it. Whoever has access to the Excel file will also be able to view, run, or make a copy of the script.

  • Related