C#-Excel互操作性 [英] C# -Excel interoperability

查看:100
本文介绍了C#-Excel互操作性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从C#4.0(VS 2010 Express Edition)中调用Excel Sheet。

I want to call Excel Sheet from C# 4.0 (VS 2010 Express Edition) .

当我声明时,

Microsoft.Office.Interop.Excel.ApplicationClass excel =
    new Microsoft.Office.Interop.Excel.ApplicationClass();

excel.Visible = true;

我收到错误作为

Interop类型'Microsoft.Office.Interop.Excel.ApplicationClass'无法嵌入。

Interop type 'Microsoft.Office.Interop.Excel.ApplicationClass' cannot be embedded. Use the applicable interface instead.

什么是soultion?

What is the soultion ?

推荐答案

这里是一个处理此事的博客文章。看起来你需要更改

Here is a blog post that deals with that. Looks like you need to change

Microsoft.Office.Interop.Excel.ApplicationClass();

Microsoft.Office.Interop.Excel.Application();

这篇关于C#-Excel互操作性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆