Some solutions to the problems encountered when using shell statements in VB are as follows:
It should be a shell commandProgramAfter the execution is complete, execute the operation to display the file to textbox. Use waitforsingleobject to wait for the shell to execute the following operation.
'Declare the following APIs first
Private declare function OpenProcess lib "Kernel32" (byval dwdesiredaccess as long, byval binherithandle as long, byval dwprocessid as long) as long
Private declare function closehandle lib "Kernel32" (byval hobject as long) as long
Private declare function waitforsingleobject lib "Kernel32" (byval hhandle as long, byval dwmilliseconds as long) as long
Private const synchronize = & h100000
Private const infinite = & hffffffff
'The call is as follows:
Dim PID as long, phnd as long
PID = shell (application to be executed)
Phnd = OpenProcess (synchronize, 0, pid)
If phnd <> 0 then
Call waitforsingleobject (phnd, infinite)
Call closehandle (phnd)
'Execute the operation to read the file to textbox.
..................
Else
Msgbox "Call failed"
End if