[VBA] Error 438 when trying to open an existing Workbook

SDempster

New Member
Joined
Jan 14, 2015
Messages
6
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.
 
Ah, that makes sense. Thanks for the help! Greatly appreciated. I'll bump this if I have anymore questions.
 
Last edited:
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,217,361
Messages
6,136,103
Members
449,992
Latest member
amadams

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top