Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check if certain file/folder/Ftp file/program exist
#1
Hi,


What are the most efficient ways to confirm that certain elementss exist (and be able to ret an error if not). The point of all this is to ensure that on run, the macro can throw up an error and open configuration panel if certain elements needed in the macro don't exist/no longer exist (e.g., if user entered incorrect settings, or otherwise does something to change the computer setup like add a new drive that changes drive letters). If it matters, all elements are stored in strings.

str testdir = "f:\test\"
(check if a directory exists)

str testfile = "f:\test\file.txt"
(check if a file exists)

str testftp = "''ftp.server.com'' ''myuser'' ''mypassw0rd''"
(check if it can connect to ftp successfully. As it is, the macro ends on wrong ftp password, username or address - so I need to check connection and throw error well before it gets to that point -- which is at the end of the whole macro process, after much user entry, lengthy file conversions, archiving etc)

Thanks!

S


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)