Shouldn't VBA Shell be asynchronous?

When I call the rebol script with

call shell("rebol.exe myscript.r")

      

The shell doesn't return until the script finishes. Is there a way to get VBA Shell to be asynchronous?

+2


a source to share


2 answers


If you just want to use a function Shell

, try another option using the API:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
  (ByVal hWnd As Long, ByVal lpOperation As String, _
  ByVal lpFile As String, ByVal lpParameters As String, _
  ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long 

      



This is the complete function code ShellEx

:

http://www.vbaccelerator.com/codelib/shell/shellex.htm

+2


a source


You want to pass the second argument so that the program runs in the background. Here's the documentation .



call shell("rebol.exe myscript.r", vbMinimizedNoFocus)

      

-1


a source







All Articles