Formula Error
Hi El Bee,
The problem you're having is that your formula is testing the quoted string,
not for the presence of a file.
To test for a file you need some vba. Here's a suitable function:
Application.Volatile
Function WkBkExists(WkBk As String)
If InStr(1, WkBk, "[") Then
WkBk = Left(WkBk, InStr(1, WkBk, "[") - 1)
End If
If Dir(WkBk, vbNormal) = "" Then
WkBkExists = False
Else
WkBkExists = True
End If
End Function
To use this function:
.. open your Excel Workbook
.. press Alt-F11 to open the vba editor
.. insert a code module
.. copy the code & paste it into your module
.. press Alt-F11 again to return to the workbook
.. code your formula as:
=IF(WkBkExists('\\PANTHER\depts\TechnicalServices\ Daily Status
Report\History\[IT Daily Status 061208.xls]Executive
Summary'!$C$30),"\\PANTHER\depts\TechnicalServices \Daily Status
Report\History\[IT Daily Status 061208.xls]Executive Summary'!$C$30",0)
Cheers
--
macropod
[MVP - Microsoft Word]
"El Bee" wrote in message
...
In the formula below I'm checking to see if a file exits. If it doesn't
then zero is suppose to be the value in the cell. If the file does exists
then it's suppose to supply the value from a cell in one of the worksheets
of
the file.
I keep getting the "#REF" error which then throws the rest of my
calculations into a tail spin. What am I doing wrong here?
=IF(ISERROR("\\PANTHER\depts\TechnicalServices\Dai ly Status
Report\History\[IT Daily Status 061208.xls]"),0,
'\\PANTHER\depts\TechnicalServices\Daily Status Report\History\[IT Daily
Status 061208.xls]Executive Summary'!$C$30)
|