Rule Definition
Even if late binding offer advantages (like being version independent), it suffers from several disadvantages compared to early binding.
With early binding:
- Code is much faster
- Compiler can detect error at compilation time rather than execution time
- Intellisense is available
Remediation
Use early binding.
Violation Code Sample
dim xl as object
Set xl = CreateObject("Excel.Application")
Fixed Code Sample
dim xl as Excel.Application
Set xl = CreateObject("Excel.Application")
Related Technologies
Visual Basic
Technical Criterion
Complexity - Dynamic Instantiation
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.