Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default File exists under directory

This will work for you assumimng you meant the windows directory and not all
subdirectories. Place it in a standard code module...

Public Function FileExists(ByVal FileName As String) As Boolean
FileExists = CBool(Len(Dir("C:\Windows\" & FileName)))
End Function

--
HTH...

Jim Thomlinson


"PeterW" wrote:


Hi

I am trying to put together a report in excel that shows whether or not
certain files exist under the windows directory.

By concatenating a number of fields I produce the name of the file I
would like to check if it exists. If it exists I want the cell to
return TRUE and if not FALSE.

I think I will need a UDF to do this as I want to copy the formula to
other cells that are concatenating other filenames to check.

Any help would be appreciated.

Peter


--
PeterW
------------------------------------------------------------------------
PeterW's Profile: http://www.excelforum.com/member.php...fo&userid=6496
View this thread: http://www.excelforum.com/showthread...hreadid=493988


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default File exists under directory


Hi

I am trying to put together a report in excel that shows whether or no
certain files exist under the windows directory.

By concatenating a number of fields I produce the name of the file
would like to check if it exists. If it exists I want the cell t
return TRUE and if not FALSE.

I think I will need a UDF to do this as I want to copy the formula t
other cells that are concatenating other filenames to check.

Any help would be appreciated.

Pete

--
Peter
-----------------------------------------------------------------------
PeterW's Profile: http://www.excelforum.com/member.php...nfo&userid=649
View this thread: http://www.excelforum.com/showthread.php?threadid=49398

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default File exists under directory


Thanks Jim .. that works


--
PeterW
------------------------------------------------------------------------
PeterW's Profile: http://www.excelforum.com/member.php...fo&userid=6496
View this thread: http://www.excelforum.com/showthread...hreadid=493988

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF File Exists [email protected] Excel Programming 1 November 22nd 04 07:24 PM
Check if a directory exists and if it doesn t... Grek[_5_] Excel Programming 5 May 8th 04 09:12 PM
How to check if the directory exists? ira Excel Programming 2 January 19th 04 01:22 PM
the file already exists - do you want to replace the existing file? Paul James[_3_] Excel Programming 4 December 12th 03 02:50 AM
Verify a directory exists MacroMan[_4_] Excel Programming 3 August 8th 03 04:38 PM


All times are GMT +1. The time now is 10:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"