| |

VerySource

 Forgot password?
 Register
Search
View: 869|Reply: 3

Regarding the quotation error of the Excel class library, please help me. After a few days, I am depressed, help me!

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-11-30 21:00:01
| Show all posts |Read mode
I developed a winform program, which calls the class in excel, and I also added Microsoft.Excel 11.0 Object Library.dll in my reference,

In the quote I added:
excel.dll
Interop.Microsoft.office.Core.dll
Microsoft.office.Core.dll
But the following error message still appeared, and then I
Try to add: Microsoft.office 11.0 Object Library.dll still has the same problem:
I quoted it like this in the program:
using Excel = Microsoft.Office.Interop.Excel;

Error: The type or namespace name "Interop" does not exist in the namespace "Microsoft.Office" (is the assembly reference missing?) D:\WindowsApplication1\WindowsApplication1\XliffManager.cs 12 32 WindowsApplication1

Can you help me analyze my problem? Thank you!
Reply

Use magic Report

2

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-12-1 09:15:01
| Show all posts
I have encountered this problem before.
You try the following methods:
1 Install the .net programmability support of excel. When installing, choose a custom installation, which includes this item.
2 Find Interop.dll or Interop.Excel.dll, and manually add a reference to it.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-12-1 10:00:01
| Show all posts
using System.Globalization;
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Reflection; // For Missing.Value and BindingFlags
using System.Runtime.InteropServices;
using Excel;
using System;
using System.IO;
using System.Collections;
using System.Threading;
using Office = Microsoft.Office.Core;
using System.Diagnostics;


First add the reference, I used MOUSE point in the IDE environment, not in the code, no problem.
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

Post time: 2020-12-1 12:15:01
| Show all posts
Your problem with referencing the namespace
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list