Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Time error

Status
Not open for further replies.

Stokesy

Programmer
Jan 17, 2002
14
0
0
GB
Hi,

I'm currently getting a run-time error '35760' "Cannot coerce type" when trying to ftp a file. My help file within visual basic appears to be non-existent and wondered if someone can explain this to me.

The code preceeding the error is as follows:

FromFile = <from directory and file name>
ToFile = <to directory>
FTPError = False

Inet1.AccessType = icNamedProxy
Inet1.Proxy = <proxy server name>
Inet1.URL = <URL name>
Inet1.UserName = <username>
Inet1.Password = <password>

fStr_FTPCommand = &quot;PUT &quot; & FromFile
Inet1.Execute , &quot;cd <directory>&quot;
Do While Inet1.StillExecuting
DoEvents
Loop

Inet1.Execute , fStr_FTPCommand <-error occurs here
Do While Inet1.StillExecuting
DoEvents
Loop
 
You might try telling the FTP server where to put the file, and what to name it once it gets there.

fStr_FTPCommand = &quot;PUT &quot; & FromFile & &quot; &quot; & ToFile

BTW, Like that variable name : fStr_FTPCommand Looks familar :-D Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top