ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   UDF Not recognized (https://www.excelbanter.com/excel-worksheet-functions/254820-udf-not-recognized.html)

Rookie_User

UDF Not recognized
 
I have this in the ALT-F11, module and I get a #NAME? in the resulting cell.

Public Function Filethere(strFullPath As String) As Boolean
If Not Dir(strFullPath, vbDirectory) = vbNullString Then Filethere = True
End Function

The data looks like this.

A B
c:\text.txt =Filethere(A1)

The result is #NAME?

Basically none of my UDF's are working - any suggestions?

Don Guillett[_2_]

UDF Not recognized
 
a UDF MUST be in a REGULAR module. It may not reside in a sheet module or
ThisWorkbook module.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Rookie_User" wrote in message
...
I have this in the ALT-F11, module and I get a #NAME? in the resulting
cell.

Public Function Filethere(strFullPath As String) As Boolean
If Not Dir(strFullPath, vbDirectory) = vbNullString Then Filethere = True
End Function

The data looks like this.

A B
c:\text.txt =Filethere(A1)

The result is #NAME?

Basically none of my UDF's are working - any suggestions?



Mike H

UDF Not recognized
 
Hi,

If none of your UDf's are working then maybe you have macros disabled. If
you have, this UDF even though it works correctly will give a name error.

Close and reopen ensuring macros are enabled.
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Rookie_User" wrote:

I have this in the ALT-F11, module and I get a #NAME? in the resulting cell.

Public Function Filethere(strFullPath As String) As Boolean
If Not Dir(strFullPath, vbDirectory) = vbNullString Then Filethere = True
End Function

The data looks like this.

A B
c:\text.txt =Filethere(A1)

The result is #NAME?

Basically none of my UDF's are working - any suggestions?


Bernd P

UDF Not recognized
 
Hello,

...
If none of your UDf's are working then maybe you have macros disabled. If
you have, this UDF even though it works correctly will give a name error.
...


Or you have all single UDFs in modules with exactly the same name as
the functions :-)

Regards,
Bernd


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com