Thursday, 22 August 2013

passing argument from vba to vbs

passing argument from vba to vbs

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:\Users\mkamaraj\Desktop\test.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 vbs and the message box
is displayed..it working fine..now i need to pass text box value from
excel dba to vbscript and that value should be displayed with that vbs
message box. How can i do that?

No comments:

Post a Comment