Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thank you!
"Chip Pearson" wrote: I can't replicate your problem. The following code works for me: Sub AAA() Dim Path As String Dim X As Boolean Dim DirRes As String X = True If X = True Then Path = "\\DellLapTop\MainDrive\" Else Path = "\\Dell8250\MainDrive\" End If On Error Resume Next Err.Clear DirRes = Dir(Path, vbDirectory) If Err.Number < 0 Then Debug.Print "Drive or server does not exist.", Err.Number, Err.Description Else If DirRes = vbNullString Then Debug.Print "Drive Not Found: " & Path Else Debug.Print "Drive Found: " & Path End If End If End Sub You'll get an error if the network resource cannot be found or is unavailable. Are you sure your servers and shares are available? -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com (email address is on the web site) "Student" wrote in message ... Hello All, Thank you... up front, for what you do is greatly appreciated ! i want to execute a shell; however, the shell resides in multiple locations and i want to set the path in an IF statement then append it to the name of the bat file If LOBTitle = "doc" then path = "\\snt27\Pro\FTP\" elseif LOBTitle = "fac" then path = "\\snt28\PEM\FTP\" endif pathName = path & "run_ftp.bat" RetVal = Shell(pathName, 1) the problem is I get a procedure call error when using "pathName" variable instead of the exact path? please help thank you again |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-time Error '5' - Invalid procedure call or argument | Excel Discussion (Misc queries) | |||
Invalid procedure call or argument error | Excel Programming | |||
Run-time error '5': Invalid Procedure Call or Argument | Excel Discussion (Misc queries) | |||
Run Time Error 5 - Invalid Procedure Call or Argument Q | Excel Programming | |||
Run-time error '5':Invalid Procedure call or argument | Excel Programming |