Compile error: User-defined type not defined

Problem:

Macro will not run.

Error:

“Compile error: User-defined type not defined”

Solution:

  1. Check which line is highlighted.  In this case its Dim ie As SHDocVw.InternetExplorer.
  2. Check what Reference Library needs to be enabled for the highlighted line.  In this case Microsoft Internet Controls.
  3. Go to Tool->References->check Microsoft Internet Controls

 

VBA reference fix Compile error: User-defined type not defined

Interested in learning new skills?