Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Error in loading DLL



Whenever I try to open the code mudule , it pops up an error  "Error in loading DLL"

Some macros are running fine on my system, but one macro is giving pain to me (attached is the macro file).

While the same macro is running fine on my colleague's system.

Please help me out.




Check your references in VBA. Especially:

Visual Basic For Applications
Microsoft Excel 12.0 Object library
OLE Automation
Microsoft Office 12.0 Object library

Also, try Visible_Text            (http://www.cpearson.com/excel/MissingReferences.aspx)


If there is an error loading the DLL there is a fault either with the Excel application or the DLL. Either of these might have become corrupt, perhaps under the influence of a virus or by some less ominous process.

  1. To eliminate the virus, if any, run a good virus scan.
  2. To repair Excel run Excel's own repair feature.
    From the Control Panel select Programs > Uninstall and Change.
    Select Office (or Excel), double-click and choose Change.
    Choose "Repair". You will require access to the original installation software.
  3. There is a very good chance that the repair process will actually also include repair of the DLL. If the error persists after repairing Excel obtain a good copy of the file in question and replace it on your computer. You can get the file from a colleague or you can download it from the web. Make sure that you place the file in the correct directory.

Note that repair of Excel is a separate process from eliminating a virus. Killing the virus - if one exists - will not undo the damage it already did. And repairing Excel will not prevent the virus - if one exists - from damaging it again.


Answer the Question

You must create an account to use the forum. Create an Account or Login