Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default File Exists Formula

Is there a formula that can ba used in a cell to check if a file exists; if
the file does exists then do .......

In other languages I've used : If fexists(filename) then .....
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default File Exists Formula

I think I've used something like this before.


If Len(Dir([path and Filename])) _
Then
msgbox ("File already exists!")
end
Else:
<Your code
end if


HTH,
Paul


"El Bee" wrote in message
...
Is there a formula that can ba used in a cell to check if a file exists;
if
the file does exists then do .......

In other languages I've used : If fexists(filename) then .....



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default File Exists Formula

One note, the pathname should be in quotes unless it will be referenced by a
cell reference or variable.

HTH,
Paul

"PCLIVE" wrote in message
...
I think I've used something like this before.


If Len(Dir([path and Filename])) _
Then
msgbox ("File already exists!")
end
Else:
<Your code
end if


HTH,
Paul


"El Bee" wrote in message
...
Is there a formula that can ba used in a cell to check if a file exists;
if
the file does exists then do .......

In other languages I've used : If fexists(filename) then .....





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default File Exists Formula

Paul,

I'm struggling with the syntax.
I have file on Drive L
In the directory called TechnicalServices
Sub directory called "Daily Status Reports" (space between each word)
File name is MyFile110608.xls.

I have tried your syntax and keep getting an error; "That name is invalid"

here' the text of the formula:

=IF LEN(DIR([\\L:\depts\TechnicalServices\Daily Status Report\History\IT
Daily Status 061108.xls]))

I have tried including quotes but I get the same error; where am I going
wrong?

Thanks for your time and help.

Larry

"PCLIVE" wrote:

I think I've used something like this before.


If Len(Dir([path and Filename])) _
Then
msgbox ("File already exists!")
end
Else:
<Your code
end if


HTH,
Paul


"El Bee" wrote in message
...
Is there a formula that can ba used in a cell to check if a file exists;
if
the file does exists then do .......

In other languages I've used : If fexists(filename) then .....




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default File Exists Formula

Sorry Larry,

I overlooked the fact that you posted this in worksheet functions. The
solution I gave you would be used in a Macro (Visual Basic). I'm not
exactly sure how to do it in a function.
Maybe something like:

=IF(ISERROR('L:\depts\TechnicalServices\Daily Status Report\History\[IT
Daily Status 061108.xls]Sheet1'!$A$1)=TRUE,"File does not exist!","File
already exists!")

There may be another way to better suit your needs, but that's all I could
come up with right now.

HTH,
Paul


"El Bee" wrote in message
...
Paul,

I'm struggling with the syntax.
I have file on Drive L
In the directory called TechnicalServices
Sub directory called "Daily Status Reports" (space between each word)
File name is MyFile110608.xls.

I have tried your syntax and keep getting an error; "That name is invalid"

here' the text of the formula:

=IF LEN(DIR([\\L:\depts\TechnicalServices\Daily Status Report\History\IT
Daily Status 061108.xls]))

I have tried including quotes but I get the same error; where am I going
wrong?

Thanks for your time and help.

Larry

"PCLIVE" wrote:

I think I've used something like this before.


If Len(Dir([path and Filename])) _
Then
msgbox ("File already exists!")
end
Else:
<Your code
end if


HTH,
Paul


"El Bee" wrote in message
...
Is there a formula that can ba used in a cell to check if a file
exists;
if
the file does exists then do .......

In other languages I've used : If fexists(filename) then .....






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
Can I write an excel formula to display the file save date? Bob-123456789 Excel Worksheet Functions 1 January 26th 06 07:50 PM
How can I make a formula in Excel showing when the file modified? TMark Excel Worksheet Functions 2 January 11th 06 11:02 AM
Weird File Open/Save As Behavior [email protected] Excel Discussion (Misc queries) 0 December 9th 05 02:26 AM
Links picking up values from an older version of linked file Cate Links and Linking in Excel 4 October 20th 05 01:53 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM


All times are GMT +1. The time now is 09:03 PM.

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

About Us

"It's about Microsoft Excel"