Xin Yi
Xin Yi

Reputation: 11

Create new workbook from office script

I would like to create a new excel workbook from office script. Is it possible to create a new workbook and give it a dynamic name (date) in office script itself?

Upvotes: 1

Views: 5124

Answers (1)

Jay Rathi - Microsoft
Jay Rathi - Microsoft

Reputation: 251

This is supported by using Office Scripts in combination with Power Automate. You can pass the dynamic name as a return value for the office script, and this can be used by the "Create file" Power Automate connector. Your Power Automate flow would look something like this -

Power Automate flow

The result value is what is returned by the Office Script. This page provides details on how you can return data from Office Scripts.

The File Content is returned by the Get File Content action. This can be a template/blank excel file.

The flow example I have above runs another script on the newly created file. This way you can do more actions on the new file if required.

Upvotes: 5

Related Questions