Function Command$() As String Member of VBA.Interaction Returns the argument portion of the command line
获取命令行中输入的参数举例:在工程-工程属性-生成选项卡中 有个命令行参数,是用来模拟命令行输入参数的,你输入数值或者字符都可以 示例输入 50则下列的代码,执行后会弹出对话框显示 50Private Sub Command1_Click() Dim strID As String strID = Command$ MsgBox strID End Sub
Member of VBA.Interaction
Returns the argument portion of the command line
有个命令行参数,是用来模拟命令行输入参数的,你输入数值或者字符都可以 示例输入 50则下列的代码,执行后会弹出对话框显示 50Private Sub Command1_Click()
Dim strID As String
strID = Command$
MsgBox strID
End Sub
执行
xxx.exe yyy
那么command$ 就是 "yyy"