Excel.ApplicationClass它不起作用. [英] Excel.ApplicationClass it does not work.

查看:111
本文介绍了Excel.ApplicationClass它不起作用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用
使用Microsoft.Office.Interop.Excel;
使用Microsoft;

当我在主目录中使用Excel.ApplicationClass时不起作用.
我必须使用Microsoft.Office.Interop.Excel.ApplicationClass

While using
using Microsoft.Office.Interop.Excel;
using Microsoft;

when i use Excel.ApplicationClass in main it does not work.
i have to use Microsoft.Office.Interop.Excel.ApplicationClass
Is this necessary or am i missing something ?

推荐答案

据我了解,您在使用using语句时遇到问题...

ApplicationClass类位于Microsoft.Office.Interop.Excel命名空间中.因此,如果您编写以下内容:
As far as I understand you have problems with the using statements...

The ApplicationClass class is in the Microsoft.Office.Interop.Excel namespace. Thus if you write the following:
using Microsoft.Office.Interop.Excel;


...那么您以后就不能在代码中使用Excel.ApplicationClass了,只需要在没有Excel名称空间的情况下使用ApplicationClass ...或者,如果出于某些原因要编写Excel.ApplicationClass,则必须使用以下using语句:


...then you can''t use Excel.ApplicationClass later in the code, just use ApplicationClass without the Excel namespace... Or, if for some reason you want to write Excel.ApplicationClass, then you have to use the following using statement:

using Microsoft.Office.Interop;



希望对您有所帮助.如果没有,请更好地说明您的问题.



I hope this helped... if not, please specify your problem better.


这篇关于Excel.ApplicationClass它不起作用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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