Feedback by UserVoice

I suggest you ...

Invoke built-in ribbon commands from Javascript

We are able to invoke a built-in Ribbon command in VBA by using:

Application.CommandBars.ExecuteMso(“Copy”)

Could we have a way to invoke built-in functionality from Javascript

31 votes
Vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
You have left! (?) (thinking…)
Anonymous shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

2 comments

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...
  • Dan Moorehead commented  ·   ·  Flag as inappropriate

    Office Extensibility Team,

    Can you please provide any kind of idea of when or whether this might be implemented (as it's been in the backlog for nearly 2 years)?
    Is this something you might be able to move up in the backlog as a higher priority so likely to be addressed?

    Support for executing commands / automating UI would be extremely helpful in helping to bridge the gap between what is possible with JavaScript / Office.js vs. VBA / Automation APIs, and provide a lot of functionality even with just one new method like:

    Application.executeUICommand(command: string | UICommand)

    Ideally you could provide an enum like UICommand with string values auto-generated from list of known/most common commands, like from either:
    https://docs.microsoft.com/en-us/openspecs/office_standards/ms-customui/bb5bb594-ec8c-45f6-8424-f98e8308b25a
    https://docs.microsoft.com/eu-es/office/vba/office-mac/idmsoexcelmac
    However, simply executeUICommand(commandName: string) without any enum (for first version, if that simplifies and therefore helps to get this implemented sooner), and even if just for Excel at first, would be of immense value to those looking to move from VBA to JavaScript for Office Add-in development and automation.

    Thanks,
    Dan

    --

    Dan Moorehead
    Co-Founder & CTO
    PowerSheet.ai for Excel | http://PowerSheet.ai
    ● AI Powered Excel ● Smart Tables ● Easy BI
    ● Auto Forms, Reports, Pivot & Finance
    ● Excel Content Add-in & Online

Feedback and Knowledge Base