+ Reply to Thread
Results 1 to 6 of 6

VBA - API calls for FTP

  1. #1
    Registered User
    Join Date
    01-31-2011
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    VBA - API calls for FTP

    Hi Everyone,

    I'm having an issue with the FtpFindFirstFile API call.

    Here's a section of code:
    Please Login or Register  to view this content.
    InternetOpen, InternetConnect are returning valid handles, and FtpSetCurrentDirectory returns True. However, hFind returns 0, and a look at the LastDllError shows an error value of 12002 (which is a Timeout error).

    Environment: Windows7, Excel 2003, VB 6.5 on a local network.

    Any help would be much appreciated.
    Last edited by lukeB; 02-01-2011 at 02:06 AM.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA - API calls for FTP

    How have you declared pData and have you assigned a string buffer to its Filename?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    01-31-2011
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA - API calls for FTP

    pData has been declared as:

    Please Login or Register  to view this content.
    and prior to calling FtpFindFirstFile, a string buffer has been assigned as follows:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-31-2011
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA - API calls for FTP

    I've also declared the following along with pData:

    Please Login or Register  to view this content.
    Thanks for your time.

  5. #5
    Registered User
    Join Date
    01-31-2011
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA - API calls for FTP

    I've managed to fix this issue, by using a passive FTP connection flag in the InternetConnect API:

    Please Login or Register  to view this content.
    romperstomper: Thanks for your help.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA - API calls for FTP

    Thanks for posting back with the solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1