Can I assign a function in an excel add-in to a bu

2020-04-17 04:45发布

I want to have a button in the sheet that you can press that will run part of the add in. Is this possible?

1条回答
可以哭但决不认输i
2楼-- · 2020-04-17 05:28

ok ill look into that. but is there a way to do so with a button in a sheet? – Jacxel 7 mins ago

Yes you can.

I am assuming that you have an Add-In called MyAddIn.xlam and you have a procedure called `Sample()' in the module of the Add-In. I am also assuming that the Add-In is installed.

Replace the file MyAddIn.xlam with the relevant Add-In name and replace the procedure Sample with the relevant procedure name.

Option Explicit

Private Sub CommandButton1_Click()
    Application.Run "MyAddIn.xlam!Sample()"
End Sub
查看更多
登录 后发表回答