I need to set a variable and include that variable within the Shell(FP, vbNormalFocus)
I tried setting the variable as string and variant, the FP returns the correct value but the Shell does not recognize it. What am I missing?
Private Function ViDataX_Process_Request()
On Error GoTo ViDataX_Process_Request_Err
Dim lRetVal As Long 'Return value
Dim lProcId As Long 'Process id
Dim lProcHnd As Long 'Process handle
Dim FP As Variant 'String file path of
'-- Check that the ViDataX executable exists.
If ViDataX_File_Exists_W7 = True Then
FP = "mc_VIDATAX_VB_APP_W7"
ElseIf ViDataX_File_Exists_XP = True Then
FP = "mc_VIDATAX_VB_APP_XP"
MsgBox "Required ViDataX executable has not been installed on this machine." _
& vbCrLf & "Contact your application support.", vbOKOnly, "ViDataX"
'-- Open the "User Wait" form.
'-- Shell for ViDataX to process the request.
lProcId = Shell(FP, vbNormalFocus)
If lProcId <> 0 Then
'-- Get the handle to the shelled ViDataX process.
lProcHnd = OpenProcess(Synchronize, 0, lProcId)
If lProcHnd <> 0 Then
'-- Cycle until the shelled ViDataX process ends.
Do While True
lRetVal = WaitForSingleObject(lProcHnd, 30)
If lRetVal = WAIT_TIMEOUT Then
DoEvents 'Allows form displays from ViDataX
'-- Close the process handle.
'-- Close the "User Wait" form.
DoCmd.Close acForm, "FZ_ViDataX_UserWait"