The below code extracts the rar file but as i am not sure of the location of WinRar, i would need it to check two locations. The below code comes up with a type mismatch error on the WinRarPath.
Sub Extract()
Dim RarIt As String
Dim Source As String
Dim Desti As String
Dim WinRarPath As String
WinRarPath = "C:\Program Files\WinRar\" Or "C:\Program Files (x86)\WinRar\"
Source = "C:\VBA\VBA.rar"
Desti = "C:\VBA\"
RarIt = Shell(Chr(34) & WinRarPath & "WinRar.exe" & Chr(34) & " e " & Chr(34) & Source & Chr(34) & " " & Chr(34) & Desti & Chr(34), vbNormalFocus)
Application.Wait (Now + TimeValue("0:00:02"))
Kill Source
End Sub
I am hoping that it would check either location then run.