Check/count files on an FTP site using Excel VBA

NilsInc
NilsInc used Ask the Experts™
on
I need a simple way to check if any files has been placed in a folder on an FTP site. I would like to get a simple Excel VBA sample code using the following:
Site = ftp.commerce.net
Username="myName"
Password="12345"

Thank you,

Nils
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Application Consultant
Commented:
Just get a list from the remote dir and check if there are any records.

e.g. after login:

ls /mydir/* myfiles.txt
or
cd mydir
ls * myfiles.txt
or
ls *.txt myfiles.txt

Open "myfiles.txt" for Input as #1

   Dou EOF(1)
      Input #1,mf$
      Magbox "Files found on remote server"
   Loop

Close #1

Open in new window

Martin Liss"Life would be infinitely happier if we could only be born at the age of eighty and gradually approach eighteen." - Mark Twain
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial