Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default procedure call error issue

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time Error '5' - Invalid procedure call or argument Trefor Excel Discussion (Misc queries) 2 December 17th 07 03:32 AM
Invalid procedure call or argument error Patrick Simonds Excel Programming 1 August 12th 06 11:40 PM
Run-time error '5': Invalid Procedure Call or Argument Nikila Excel Discussion (Misc queries) 2 February 24th 06 09:26 PM
Run Time Error 5 - Invalid Procedure Call or Argument Q John[_110_] Excel Programming 3 September 26th 05 09:47 PM
Run-time error '5':Invalid Procedure call or argument Jan Refsdal Excel Programming 1 July 25th 03 05:14 AM


All times are GMT +1. The time now is 06:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"