Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB Register for Com Interop

i am trying to make a COM excel addin in VB from visual studio 2012, but keep getting the following error....

Error   1   The assembly 'Microsoft.Office.Tools.Common.v4.0.Utilities, Version=10.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not registered for COM Interop. Please register it with regasm.exe /tlb.  ExcelAddIn1

I have checked the "register for Com interop" check box in the properties.

I am using visual studio 2012 and excel 2010.

Any help would be appriciated.

Cheers,

Chris

like image 301
ChrisM Avatar asked Sep 20 '25 17:09

ChrisM


1 Answers

  1. Install the Office 2010 Primary Interop Redistributable (there is none for later than 2010) from https://www.microsoft.com/en-us/download/details.aspx?id=3508
  2. Open an Administrative Command Prompt
  3. Run:
cd "C:\Program Files\Reference Assemblies\Microsoft\VSTO40\v4.0.Framework"

and then

"\windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" /tlb Microsoft.Office.Tools.Common.v4.0.Utilities.dll
  1. Rebuild your VS project, it should work now.
like image 119
Aidan Avatar answered Sep 23 '25 10:09

Aidan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!