Hey all.
I am having a weird error. In my function I am opening an existing Workbook, using Find method to locate a search criteria and store its row, and using the row to find a String in "E<ROW>". This works fine on one computer in another code which I used to trouble shoot it, but when I implement the same exact code on my other computer in a different script I am running into "Error 438: Object doesn't support this property or method" right before it attempts to open the Workbook. I looked at both References on both computers and there are no differences besides the bugged computer using 'OLE Automation'. Here's the Function's code. The error happens on the 4th line.
Function findAssEgr(enNum As String) As String 'find the assigned engineer
Dim Log As Workbook
Application.EnableEvents = False
Set Log = Workbooks.Open("<LOCATION>, Test.xlsm", True, True) 'Error occurs right before this line, but doesn't highlight this
Application.EnableEvents = True
Dim rngSearch As Range, rngFound As Range
Set rngSearch = Log.Sheets("EN Log").Range("A:A")
Set rngFound = rngSearch.Find(What:=enNum, LookIn:=xlValues, LookAt:=xlPart) 'Search for the criteria's location in the test log
findAssEgr = Log.Worksheets("EN Log").Cells(rngFound.Row, 5) 'Assigned Engineer's name
Log.Close False
End Function
Another thing to note is that if I exclude the Application.EnableEvents on line 3 I get "Automation Error, Library not registered" at the same location.
I am having a weird error. In my function I am opening an existing Workbook, using Find method to locate a search criteria and store its row, and using the row to find a String in "E<ROW>". This works fine on one computer in another code which I used to trouble shoot it, but when I implement the same exact code on my other computer in a different script I am running into "Error 438: Object doesn't support this property or method" right before it attempts to open the Workbook. I looked at both References on both computers and there are no differences besides the bugged computer using 'OLE Automation'. Here's the Function's code. The error happens on the 4th line.
Function findAssEgr(enNum As String) As String 'find the assigned engineer
Dim Log As Workbook
Application.EnableEvents = False
Set Log = Workbooks.Open("<LOCATION>, Test.xlsm", True, True) 'Error occurs right before this line, but doesn't highlight this
Application.EnableEvents = True
Dim rngSearch As Range, rngFound As Range
Set rngSearch = Log.Sheets("EN Log").Range("A:A")
Set rngFound = rngSearch.Find(What:=enNum, LookIn:=xlValues, LookAt:=xlPart) 'Search for the criteria's location in the test log
findAssEgr = Log.Worksheets("EN Log").Cells(rngFound.Row, 5) 'Assigned Engineer's name
Log.Close False
End Function
Another thing to note is that if I exclude the Application.EnableEvents on line 3 I get "Automation Error, Library not registered" at the same location.