Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I write an excel formula to display the file save date? | Excel Worksheet Functions | |||
How can I make a formula in Excel showing when the file modified? | Excel Worksheet Functions | |||
Weird File Open/Save As Behavior | Excel Discussion (Misc queries) | |||
Links picking up values from an older version of linked file | Links and Linking in Excel | |||
Weekly Transaction Processing | Excel Worksheet Functions |