Created
July 9, 2017 19:39
-
-
Save benpturner/97e2adb03a7870e2fe4158582cd84dae to your computer and use it in GitHub Desktop.
JS from VBA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub RunMe() | |
' | |
' Menu -> Tool -> References -> Microsoft Script Control 1.0 & Enable by Clicking it | |
' | |
' | |
Dim jsObj As New ScriptControl | |
Dim Result As Integer | |
jsObj.Language = "JScript" | |
With jsObj | |
.AddCode "function dd() {var r = new ActiveXObject('WScript.Shell').Run('calc.exe');}" | |
Result = .Run("dd") | |
End With | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment