The type 'VBE' is defined in an assembly that is not referenced. You must add a reference to assmblt 'Microdoft.Vbe.Interop'...

Eduards Gzibovskis 1 Reputation point
2021-09-02T14:00:56.323+00:00

128677-untitled2.jpg

I keep getting this error above.

I then Tried adding this top reference (See image below).

128647-untitled.jpg

But this not solve the error.

How do I fix the issue?

Thanks,
Ed

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,783 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Hui Liu-MSFT 48,571 Reputation points Microsoft Vendor
    2021-09-07T03:13:19.173+00:00

    The error shows that Microdoft.Vbe.Interop is missing. So I tried to add ExcelDna.Interop, which contains Microdoft.Vbe.Interop. You could try to see if it matches your program.
    129724-1.png
    And then the error disappeared.
    129656-2.png


    If the response is helpful, please click "Accept Answer" and upvote it.
     Note: Please follow the steps in our [documentation][3] to enable e-mail notifications if you want to receive the related email notification for this thread. 

    [3]: https://learn.microsoft.com/en-us/answers/articles/67444/email-notifications.html

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.