Microsoft Visual Basic Runtime Error 53 On A

Error

Written by Luke Chung, FMS President

RuntimeBasic

You've created a Microsoft Access database solution and have successfully distributed it to many people. Everyone is running it properly but one machine is triggering this error. The error message makes no sense and everything you try fails to resolve the problem. What's going on?

Microsoft Visual Basic Runtime Error 53 On A Windows 10

File name or class name not found during Automation operation (Visual Basic) File not found (Visual Basic Run-Time Error) File specified by FileName does not use the encoding specified by FileEncoding. File specified in FileName is not a valid XML file. File's open mode wasn't set to a valid value. For loop not initialized (Visual Basic). For example, the properties and methods of the VBE object for manipulating the Visual Basic for Applications (VBA) code that is stored in a Microsoft Office document are inaccessible by default. To turn on trusted access to Visual Basic Projects, do the following: Enable the Developer tab on the ribbon. See Show the Developer tab for more. This site contains user submitted content, comments and opinions and is for informational purposes only. Apple may provide or recommend responses as a possible solution based on the information provided; every potential issue may involve several factors not detailed in the conversations captured in an electronic forum and Apple can therefore provide no guarantee as to the. Stack Exchange network consists of 178 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Active Oldest Votes. I ended up specifying directory as a separate variable and appended the sFile name to it when opening the file. Dim directory As String directory = 'H: My Documents Loma CW3 Reports Product Statistics ' sFile = Dir (directory & '.txt.') Do Until sFile = ' Open (directory & sFile) For Input As #1 blah blah blah.

The MS Access database actually runs so it's compiled and functional. It doesn't seem corrupt since others can run the same database, yet this error appears when very simple ADO code such as CurrentProject.Connection is run to open a table or query recordset:

We've actually had reports of this problem for years but were never able to reproduce the problem. We finally did and have a solution.

The 'Class Not Registered' message is very confusing. Which class is not registered? And what's the problem with this machine when the database runs successfully on other PCs?

The message implies it is caused by code that won't compile, but the code compiles and is running fine before this crash occurs. Common techniques such as decompiling the database make no difference.

Runtime

Is it a broken library reference? Checking the list of referenced libraries doesn't reveal any problems. Is the database corrupt?

The symptom can exist if you create a new database and run this in the Immediate Window:

? CurrentProject.Connection

This simple test effectively rules out any issues associated with your database. This basic Microsoft Access VBA command won't even run on a blank database.

The CurrentProject object is part of Microsoft Access. It's not something a developer adds. The problem exists within MS Access, not your database, so the fix is at the Access/Office level.

One of the causes for this error appears to be related to uninstalling another version of Access after your version of Access was installed. This may include uninstalling runtime versions of Access.

For instance, your machine may have Access 2007 installed on it. Access 2013 was later installed, and then Access 2007 uninstalled. Access 2013 seems to be running properly but it fails when this code is run. For some reason, the uninstallation of the prior version of Access makes the current one you're running unstable.

Microsoft Visual Basic Runtime Error 53

It may also be related to the installation of Windows updates and security patches. And of course, it could be caused by unknown file corruptions. Thankfully, this error doesn't happen often.

The solution we've found is very straightforward. Just fix (repair) the installation of Microsoft Office/Access. You may need Administrator permissions to do this.

Go under the Control Panel, Programs, Programs and Features, select 'Microsoft Office Professional Plus 2013' (or your version of Access) and click on Change:

Visual Basic Runtime Error 53

Runtime

When the next screen appears, select Repair:

It takes a while, but after Office and Access are repaired, the problem goes away.

Microsoft Visual Basic Runtime Error 53 On A Chromebook

Confirm it's fixed by running Microsoft Access, opening a database, and testing CurrentProject.Connection in the Immediate Window. It should now work.

If it doesn't work, you may need to uninstall and reinstall Microsoft Office and Access.

Have any suggestions or comments? Head to our blog post Microsoft Access Class Not Registered Run-time Error -2147221164 (80040154) and leave us your feedback!

Hope this helps!