mauricionava
Programmer
Hello, I have a batch file that runs with a button and after the batch file runs I have some more coding that does not work until the process in the batch file finishes. How can I insert a delay between the batch file command and the rest of the code behind the button?
Thanks a lot.
This is the code:
Thanks a lot.
This is the code:
Code:
Dim stAppName As String
Dim loanPath As String
Dim dealerPath As String
Dim userPath As String
stAppName = "\\Nal-01\data\Information Tech\LOS3\CloseTifViewer.bat"
Call Shell(stAppName, 1)
** I NEED TO INSERT DELAY HERE **
loanPath = "W:\" & Me.cmbDealerShort.Value & "\" & Me.txtAcct.Value & " - " & Me.txtBUYER.Value ' this is the account folder
dealerPath = "W:\" & Me.cmbDealerShort.Value ' this is the main dealer folder
userPath = "\\nal-file01\Production\UserFaxQ\" & Me.quserid.Value ' this is the user's queue folder for faxes
'MkDir "\\nal-file01\Production\UserFaxQ\" & Me.quserid.Value
Dim fso
Dim sfolder As String, dfolder As String ' sfolder is Source Folder. dfolder is Destination Folder.
sfolder = userPath
dfolder = loanPath
Set fso = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
If Not fso.FolderExists(sfolder) Then
MsgBox "The folder/path " & sfolder & " has not been created.", vbInformation, "Invalid Source"
ElseIf Not fso.FolderExists(dfolder) Then
MsgBox "The folder/path " & dfolder & " is not valid.", vbInformation, "Invalid Destination"
Else
fso.MoveFile (sfolder & "\*.*"), dfolder
End If
If Err.Number = 53 Then MsgBox "Files not found in the temporary fax folder.", vbInformation, "No Files Found"