Add link to Office Script to button

Jonathan Giunta 0 Reputation points
2023-04-19T09:06:36.8866667+00:00

Hello all, I need to create a button in an Online Excel file that, when clicked, starts an Office Script. Now, i know how to programmatically create a "button" shape, but i don't know how to attach links to it. I've seen that the "Shape" object has a property called "m_scriptLink" that contains the link to the script when the button is generated by excel (Clicking "add button" when you are on the "automate" section and select a script). How can I programmatically set this link or access this property?

Microsoft 365 and Office Development Office JavaScript API
Microsoft 365 and Office Install, redeem, activate For business Windows
Microsoft 365 and Office Excel For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. shahzeb-msft 0 Reputation points Microsoft Employee
    2023-04-26T23:11:39.2033333+00:00

    Hi Jonathan, we don't provide a way to programmatically create script buttons right now. But thanks for providing useful feedback!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.