S
StephenW
I have a macro which uses a Shell FTP to retrieve a file from UNIX to Windows
to be used as a data source for a mail merge (just acomma deleimited test
file). At one site which is running Windows XP and Word 2002 I'm having
problems with the FileSearch object not finding the file after the successful
Transfer of the file.
First the user was getting a runtime error #70 Permission Denied and after
checking with the site's IT dept. and being assured that the user has Full
rights to the network directories where the action is taking place, the error
continued. I then commented out a KILL command which got rid of the
premissions error (it deletes the script I created to be used in the FTP),
but after that the macro does a file search to be sure that the file is
really there and it always fails, even though I can see the file in the
directory.
The code is:
'***** Delete file with userinformation
Kill (DownloadPath & "Ftpget.txt")
'***** Check if file is present after download
Set objFSO = Application.FileSearch
With objFSO
.LookIn = DownloadPath '***Path to where file is
.FileName = FileToGet '**Name of file
.MatchTextExactly = True
If Not .Execute > 0 Then
'***** File doesn't exists, display error message!
ElseIf FileLen(DownloadPath & FileToGet) < 10 Then
'***** File does infact exists, now check if it is more then 0 bytes =)
error message2
Else
'***** File download succesfull
End If
End With
Set objFSO = Nothing
The user always recieves the first error message. I've check the references
and they are all the same. This code works at other sites. Is there
something that was not installed on this user's machine? Can anybody help?
I'm out of ideas.
Thanks,
Steve
to be used as a data source for a mail merge (just acomma deleimited test
file). At one site which is running Windows XP and Word 2002 I'm having
problems with the FileSearch object not finding the file after the successful
Transfer of the file.
First the user was getting a runtime error #70 Permission Denied and after
checking with the site's IT dept. and being assured that the user has Full
rights to the network directories where the action is taking place, the error
continued. I then commented out a KILL command which got rid of the
premissions error (it deletes the script I created to be used in the FTP),
but after that the macro does a file search to be sure that the file is
really there and it always fails, even though I can see the file in the
directory.
The code is:
'***** Delete file with userinformation
Kill (DownloadPath & "Ftpget.txt")
'***** Check if file is present after download
Set objFSO = Application.FileSearch
With objFSO
.LookIn = DownloadPath '***Path to where file is
.FileName = FileToGet '**Name of file
.MatchTextExactly = True
If Not .Execute > 0 Then
'***** File doesn't exists, display error message!
ElseIf FileLen(DownloadPath & FileToGet) < 10 Then
'***** File does infact exists, now check if it is more then 0 bytes =)
error message2
Else
'***** File download succesfull
End If
End With
Set objFSO = Nothing
The user always recieves the first error message. I've check the references
and they are all the same. This code works at other sites. Is there
something that was not installed on this user's machine? Can anybody help?
I'm out of ideas.
Thanks,
Steve