Tuesday, October 13, 2015

How to fix automation error in VBA-Marco

If you are getting automation error in your VBA protect. Then below steps possibly fix your problem:
Cause:
Such issue can arise due to mscomctl.ocx file which is an common control library
Fix:
If your project is throwing an error on specific machine then it can be a version issue of common control library. In such situations cross check version of culprit library with one on working machine. if any discrepancy found then take library from working machine and replace with culprit machine.
Mostly you will find such library in system32 folder or you can search them in file system or you can also see location in Tools->Library menu in VBA editor window of VBA by selecting respective library as shown below:

Once you replace library then register library with below command in command prompt or Run window:

Regsv32 /u "complete path of library"

to unload file then 

Regsv32 "complete path of library"

to register file. if you get any error then try with admin access.

1 comment: