如果我设置一个子程序,以便可以从客户功能区按钮调用它,是否仍然可以从其他子程序调用这些子程序?我得到的参数不是可选的错误信息,但我不确定传递给子程序的参数是什么,因为我不是从功能区按钮调用,而是从另一个子程序本身调用。
Sub Reset(ByVal Control As IRibbonControl)
Call ResetForumlas
Call ResetValues
End Sub
Sub ResetForumlas(ByVal Control As IRibbonControl)
"Do some stuff"
End Sub
Sub ResetValues(ByVal Control As IRibbonControl)
"Do Some more stuff"
End Sub
感谢您的帮助。
答案 0 :(得分:1)
请不要拨打电话。喜欢这个
Sub Reset(ByVal Control As IRibbonControl)
ResetForumlas
ResetValues
End Sub
Sub ResetForumlas(ByVal Control As IRibbonControl)
"Do some stuff"
End Sub
Sub ResetValues(ByVal Control As IRibbonControl)
"Do Some more stuff"
End Sub
答案 1 :(得分:1)
这是一个旧帖子,但是如果有人到达这里...请尝试以下操作:
Sub Reset(ByVal Control As IRibbonControl)
Call ResetForumlas
Call ResetValues
End Sub
sub test
dim ribboncontrol as IRibbonControl
call Reset (ribboncontrol)
end sub
答案 2 :(得分:0)
不,这对我不起作用,但我确实设法解决了。似乎只是将它作为可选变量传递似乎在那种情况下工作得很好。谢谢你的帮助。
Sub Reset(Optional ByVal Control As IRibbonControl)
ResetForumlas
ResetValues
End Sub
Sub ResetForumlas(Optional ByVal Control As IRibbonControl)
"Do some stuff"
End Sub
Sub ResetValues(Optional ByVal Control As IRibbonControl)
"Do Some more stuff"
End Sub