I have one vb script and excel page with command button.
vb script---test.vbs
MsgBox("Hello world")
excel vba code
Private Sub CommandButton1_Click()
Dim SFilename As String
SFilename = "C:UsersmkamarajDesktopest.vbs" 'Change the file path
' Run VBScript file
Set wshShell = CreateObject("Wscript.Shell")
wshShell.Run """" & SFilename & """"
End Sub
When I click the button in Excel it executes the VBScript
and the MessageBox
is displayed. Now, I need to pass the TextBox
value from Excel VBA
to VBScript
and that value should be displayed with that VBScript
MessagBox
.
How can I do that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…