0

Using Bitbucket as remote repo. Created a Https token in bitbucket

When trying to clone using Visual Studio it asked for username and password. I provided with my username and for password gave the token. After sometime getting the following popup with error message :

Git failed with a fatal error. Must specify at least one AuthenticationModes Parameter name: modes

After closing the error popup, I saw all the files were present in the destination folder .. so tried to build the project.

When I build my project I am getting error saying

The type or namespace name 'Excel' does not exist in the namespace 'Microsoft.Office.Interop' (are you missing an assembly reference?)

In the .csproj file there is a statement:

<COMReference Include="Microsoft.Office.Interop.Excel">

Using Visual Studio professional 2022 17.4.20.

I tried to clone the repo using sourcetree and git bash as well ..it was able to clone but after that upon trying to build the project getting the same error as

The type or namespace name 'Excel' does not exist in the namespace 'Microsoft.Office.Interop' (are you missing an assembly reference?)

Only I am facing this issue. no one else in the project are getting any such build error. Kindly let know..

13
  • 1
    no one else in the project are getting any such build error: If there are others working on this project, then the first thing you should have done is to ask one or more of them for assistance - this is known as teamwork.
    – user246821
    Commented Jul 10 at 3:08
  • Everyone in the project have helped me in finding a solution for the same... but still there is this issue not getting resolved Commented Jul 10 at 3:13
  • Do you have the same version of Excel (or MS Office) installed as the others?
    – user246821
    Commented Jul 10 at 4:00
  • Yes Microsoft 365 (Office) Commented Jul 10 at 4:13
  • Unfortunately, this post is missing a lot of relevant information.
    – user246821
    Commented Jul 10 at 13:26

1 Answer 1

0

Firstly, ensure excel software correctly installed in your PC.

If MS Office is not installed on your PC, you can install it via NuGet packages in Visual Studio or download the installer from this link.: https://www.microsoft.com/en-us/microsoft-365/download-office?msockid=279bd90c922766f01403c8e193a267f6

In your Visual Studio project, ensure that the COMReference part is correctly defined in your .csproj project file like this:

<ItemGroup>
  <COMReference Include="Microsoft.Office.Interop.Excel">
    <Guid>{00020813-0000-0000-C000-000000000046}</Guid>
    <VersionMajor>1</VersionMajor>
    <VersionMinor>9</VersionMinor>
    <Lcid>0</Lcid>
    <WrapperTool>tlbimp</WrapperTool>
    <Isolated>false</Isolated>
  </COMReference>
</ItemGroup>
3
  • This is the same details present in the .csproj file .. thanks Commented Jul 11 at 3:54
  • All other members in my team have the following in COM reference dlls displayed as below : ACTIVEXLib, Microsoft.Office, Microsoft.Office.Interop, Microsoft.Office.Interop.Access,VSTOEE100...... And In my project COM reference : I have the following : Interop.Microsoft.Office.Core, Interop.Microsoft.Office.Access.Dao, Interop.VSTOEE100 and its throwing error saying : The type or namespace name 'Excel' does not exist in the namespace 'Microsoft.Office.Interop' (are you missing an assembly reference?) Commented Jul 11 at 6:54
  • for All other team members "Microsoft Excel 16.0 Object Library" is one of library that is checked in COM -> Add Reference popup dialog... and I dont have it in my COM reference dialog ...how and where can I find this library to install .. kindly let know Commented Jul 11 at 7:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.