0

Just before I got a problem with excel and I recovered MS Office with online option. After that my excel works well, but my project in Visual Basic VB.NET lost excel reference(Microsoft.Office.Interop). I recovered already Visual Studio, but it still loses reference. I use Office Home & Student 2019 and Visual Studio 2019. Please, help me to fix it. enter image description here

sem
  • 49
  • 4
  • What do you mean by "loses reference"? Do you mean that it's missing and can't be re-added? Or that it randomly disappears after being added? More explicit info please. – SteveCinq Dec 08 '20 at 17:31
  • As you can see the picture, then you can see that I chceked already Office 16.0 that means Office 2019. But why tell the VS that the Microsoft.Office.Interop is unnecessary? Before I recovered MS Office, everything worked well. Do you have any experience or idea to fix it? – sem Dec 08 '20 at 17:47
  • Refer my answer regarding the `Microsoft.Office.Interop.Excel` extension library. What you're adding here is an old COM library. You're not using VBA, are you? You've said `VB.NET` in your question title. – SteveCinq Dec 08 '20 at 17:56
  • Thank you for your fast comment! I searched in extension library, but the all of type "Microsoft.Office.---" doesn't exist... – sem Dec 08 '20 at 18:03
  • I think that I found the solution. I googled it and I just add it that is in here "C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel". Is that right? – sem Dec 08 '20 at 18:11

1 Answers1

0

Have you tried simply adding the Microsoft.Office.Interop.Excel extension library?

enter image description here

Further to your comments, if that reference isn't available/visible, check this SO question: Microsoft.Office.Interop.Excel Reference Cannot be found.

Personally, out of the answers there, I'd try the NuGet option first:

enter image description here

SteveCinq
  • 1,920
  • 1
  • 17
  • 22
  • Than you for your answer, I searched it in the extensions, but I have no "Microsfot.Office.---"... – sem Dec 08 '20 at 18:01
  • I think that I found the solution. I googled it and I just add it that is in here "C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel". Is that right? – sem Dec 08 '20 at 18:11