Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vba - Checking existence of file
Hi all,
First of all, I 'd like to thanks you all for your kindly assistence. Now, I have this situation: Before running macro, I need to check the existence of specific file. I have the path and file name. Is there any way to check the existence of the file in the indicate folder? something like... object.exists filename=Path & FileName Thanks in advance. Aldo -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vba - Checking existence of file
Aldo,
Use the Dir function. If it returns an empty string, the file does not exist. E.g., If Dir(Filename) = "" Then ' file does not exist Else ' file exists End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "ajliaks " wrote in message ... Hi all, First of all, I 'd like to thanks you all for your kindly assistence. Now, I have this situation: Before running macro, I need to check the existence of specific file. I have the path and file name. Is there any way to check the existence of the file in the indicated folder? something like... object.exists filename=Path & FileName Thanks in advance. Aldo. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Checking for the existence of a worksheet | Excel Discussion (Misc queries) | |||
Checking for the existence of a characted in a string | Excel Discussion (Misc queries) | |||
Checking for existence of excel | Excel Programming | |||
Checking for existence of excel | Excel Programming | |||
Checking for the Existence of a Folder | Excel Programming |