我有一个vb脚本和带有命令按钮的excel页面。将参数从vba传递给vbs
VB脚本--- test.vbs
MsgBox("Hello world")
Excel中的VBA代码
Private Sub CommandButton1_Click()
Dim SFilename As String
SFilename = "C:\Users\mkamaraj\Desktop\test.vbs" 'Change the file path
' Run VBScript file
Set wshShell = CreateObject("Wscript.Shell")
wshShell.Run """" & SFilename & """"
End Sub
当我点击Excel中的按钮,它执行VBScript
并显示MessageBox
。现在,我需要将TextBox
值从Excel VBA
到VBScript
并且该值应该与VBScript
MessagBox
一起显示。
我该怎么做?
mehow,感谢您的有用编辑 – Pinky