Hi grovithis, I'm AS400 user too. Please try this.
<pre>
'--Please copy this into a standard module -----------------------------------
Public Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Public Declare Function WaitForSingleObject Lib "kernel32" _
(ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public Const SYNCHRONIZE = &H100000
Public Const INFINITE = &HFFFF
Sub Automatic()
Call Copydata
Call Run_bat
Call Copydata2
Call Clearsheets
Call makeheadings
Call MakeSales
Call Hidecol
End Sub
Sub Run_bat()
Dim lngRtn As Long
Dim lngProID As Long
Dim lngProHn As Long
'Please modify the path (I can not input here "/")
lngProID = Shell("o:as400test.bat")
lngProHn = OpenProcess(SYNCHRONIZE, True, lngProID)
lngRtn = WaitForSingleObject(lngProHn, INFINITE)
lngRtn = CloseHandle(lngProHn)
End Sub
'-------------------------------------------------------------------------------
</pre>