L
Laura
Good morning,
I have a module I am trying to run but it won't wait for
the application to finish going through the steps. Here is
what I have so far:
--------------------------
Option Compare Database
Option Explicit
Private Sub Upload_Yardcheck_Click()
Dim returnvalue As String
Dim temp As String
Dim strMsg As String
Dim Tasks
strMsg = "Enter your facility"
temp = InputBox(Prompt:=strMsg, Title:="Facility Name",
XPos:=2000, YPos:=2000)
returnvalue = Shell("C:\Program Files\American
Microsystems, Ltd\M5000 Utilities\m5000p.exe", 1) '
Shell M5000.
SendKeys "%c", True 'open communications menu
SendKeys "A", True ' open auto recieve.
SendKeys temp, True 'enters directory where file will be
saved.
Do Until Tasks = 0
Tasks = Tasks.Exists("m5000p")
Loop 'Until Tasks = 0
MsgBox "The application has quit."
'itrErrTrap: ' Note: This line must be left aligned.
' If Err > 0 Then MsgBox Err.Description
SendKeys "%S", True 'Save file
SendKeys "%Y", True 'Overwrite file
SendKeys "{enter}", True 'recieve file
SendKeys "{enter}", True
SendKeys "{tab}", True
SendKeys "{enter}", True
SendKeys "%{F4}", True
Exit Sub
End Sub
--------------------------------
Any thoughts anyone can offer would be greatly appreciated.
Thank you
Laura
I have a module I am trying to run but it won't wait for
the application to finish going through the steps. Here is
what I have so far:
--------------------------
Option Compare Database
Option Explicit
Private Sub Upload_Yardcheck_Click()
Dim returnvalue As String
Dim temp As String
Dim strMsg As String
Dim Tasks
strMsg = "Enter your facility"
temp = InputBox(Prompt:=strMsg, Title:="Facility Name",
XPos:=2000, YPos:=2000)
returnvalue = Shell("C:\Program Files\American
Microsystems, Ltd\M5000 Utilities\m5000p.exe", 1) '
Shell M5000.
SendKeys "%c", True 'open communications menu
SendKeys "A", True ' open auto recieve.
SendKeys temp, True 'enters directory where file will be
saved.
Do Until Tasks = 0
Tasks = Tasks.Exists("m5000p")
Loop 'Until Tasks = 0
MsgBox "The application has quit."
'itrErrTrap: ' Note: This line must be left aligned.
' If Err > 0 Then MsgBox Err.Description
SendKeys "%S", True 'Save file
SendKeys "%Y", True 'Overwrite file
SendKeys "{enter}", True 'recieve file
SendKeys "{enter}", True
SendKeys "{tab}", True
SendKeys "{enter}", True
SendKeys "%{F4}", True
Exit Sub
End Sub
--------------------------------
Any thoughts anyone can offer would be greatly appreciated.
Thank you
Laura