title: VBA Runtime error '-2147221164 (80040154)': class not Registered
body: <p>I developed a class library in Visual Studio 2019 using the .NET framework. Before building the project, I registered the.dll file to interop COM, and this process gave me a .tlb file. This class library was developed in VB.NET, besides that, it has a simple code: one class with one function (class <code>calcular</code>, function <code>Soma</code>):</p>
  <p><a href="https://i.stack.imgur.com/1mzQx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1mzQx.png" alt="" /></a></p>
  <p>It was possible to include the .tlb file in the reference of VBA and I develop a code in this language that uses the class of VB.NET to build the action of the button:</p>
  <p><a href="https://i.stack.imgur.com/Lb9ad.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Lb9ad.png" alt="" /></a></p>
  <p>On the other hand, when I execute the code in VBA Excel it shows this message:</p>
  <p><a href="https://i.stack.imgur.com/5NKSk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5NKSk.png" alt="" /></a></p>
  <p>If a press the button debug &quot;Depurar&quot; VBA mark the line of the instance of the class</p>
  <p><a href="https://i.stack.imgur.com/GQ9XO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GQ9XO.png" alt="" /></a></p>
  <p>I read other questions about this error but there isn't a way to solve it without change my machine?</p>
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/38570140/adodb-connection-in-vb6-open-method-fails-with-runtime-error-2147221164-8004">ADODB.Connection in VB6 - Open Method fails with Runtime Error &#39;2147221164 (80040154)&#39;</a></p>
  </li>
  <li><p><a href="https://stackoverflow.com/questions/62239548/vba-selenium-class-not-registered-80040154">VBA Selenium &quot;class not registered&quot;- 80040154</a></p>
  </li>
  </ul>
  <p>I already made a repair in my MS Office getting to uninstall to install again, can you help me to solve this error that prevents a run of my library in Excel VBA?</p>