Excel.ApplicationClass它不起作用. [英] Excel.ApplicationClass it does not work.
问题描述
使用
使用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 theusing
statements...
TheApplicationClass
class is in theMicrosoft.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屋!