ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   WorksheetFunction (https://www.excelbanter.com/excel-programming/286659-worksheetfunction.html)

Mike Fogleman

WorksheetFunction
 
I get the runtime error 1004: Unable to get the Find property of the
WorksheetFunction class.
Can any body point that problem?

Dim fileToOpen, dname, fname

fileToOpen = Application _
.GetOpenFilename("Database Files (*.dbf), *.dbf")
fname = Left((Right(fileToOpen, 11)), 7)
If IsError(Application.WorksheetFunction.Find("\", fileToOpen, 4)) = True
Then
dname = Left(fileToOpen, 3)
Else
dname = Left(fileToOpen, Application.WorksheetFunction.Find("\", fileToOpen,
4) - 1)
End If



Mike Fogleman

WorksheetFunction
 
If the Find function is in error and cannot find "\" then the runtime error
occurs, if Find does see a "\" then the function works.
"Mike Fogleman" wrote in message
...
I get the runtime error 1004: Unable to get the Find property of the
WorksheetFunction class.
Can any body point that problem?

Dim fileToOpen, dname, fname

fileToOpen = Application _
.GetOpenFilename("Database Files (*.dbf), *.dbf")
fname = Left((Right(fileToOpen, 11)), 7)
If IsError(Application.WorksheetFunction.Find("\", fileToOpen, 4)) = True
Then
dname = Left(fileToOpen, 3)
Else
dname = Left(fileToOpen, Application.WorksheetFunction.Find("\",

fileToOpen,
4) - 1)
End If





Mike Fogleman

WorksheetFunction
 
Never mind. I had a temp loss of memory on using InStr instead of
wsfunction.Find.
"Mike Fogleman" wrote in message
...
If the Find function is in error and cannot find "\" then the runtime

error
occurs, if Find does see a "\" then the function works.
"Mike Fogleman" wrote in message
...
I get the runtime error 1004: Unable to get the Find property of the
WorksheetFunction class.
Can any body point that problem?

Dim fileToOpen, dname, fname

fileToOpen = Application _
.GetOpenFilename("Database Files (*.dbf), *.dbf")
fname = Left((Right(fileToOpen, 11)), 7)
If IsError(Application.WorksheetFunction.Find("\", fileToOpen, 4)) =

True
Then
dname = Left(fileToOpen, 3)
Else
dname = Left(fileToOpen, Application.WorksheetFunction.Find("\",

fileToOpen,
4) - 1)
End If








All times are GMT +1. The time now is 11:13 PM.

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