VBA单击Excel表单中的button

我需要单击Excel工作表上的一个button(FormControl),并通过VBA代码运行分配给它的macros。

我尝试了这里所build议的https://stackoverflow.com/questions/130166/clicking-command-button-from-other-workbook,但它没有为我工作。

有没有其他的方式来做到这一点?

这样做相当容易,即使它没有真正的logging。

CommandButton1.Value = True 

你真的尝试过吗? 因为你想要什么build议在那里 。

 Application.Run Activesheet.Shapes(1).OnAction 

如果在工作表中:

 Sheet1.CommandButton1_Click 

其他

 Sheets("Sheet Name").CommandButton1_Click