ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   does a file exist? (https://www.excelbanter.com/excel-programming/276613-re-does-file-exist.html)

Keith Willshaw

does a file exist?
 

"nath" <n@n wrote in message ...
Is there any way of checking to see if a file exists? So
if it doesnt i can generate it.

TIA

Nath


Use the Dir Function

string=Dir(pathname,attributes)

Where

string is the returned name, null if no match found
pathname = the drive\directory name (wildcards allowed)
attributes is an optional argument specifying the
type of file to list

vbNormal (Default) Specifies files with no attributes.
vbReadOnly Specifies read-only files in addition to files with no
attributes.
vbHidden Specifies hidden files in addition to files with no
attributes.
VbSystem Specifies system files in addition to files with no
attributes. Not available on the Macintosh.
vbVolume Specifies volume label; if any other attributed is specified
vbDirectory Specifies directories or folders in addition to files with
no attributes

Keith




All times are GMT +1. The time now is 09:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com