c# 中 excel 编程中的问题

来源:百度知道 编辑:UC知道 时间:2024/05/14 05:10:27
using System;

using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Core;
using Microsoft.Office.Interop.Excel;
using ea = Microsoft.Office.Interop.Excel.Application;
using ex = Microsoft.Office.Interop.Excel;
using Microsoft.Office.Interop;
using System.Reflection;

namespace exel
{
class Program
{
static void Main(string[] args)
{
ea e1 = new ea();
e1.Visible = true ;
e1.DefaultFilePath = @"c:\";

Microsoft.Office.Interop.Excel.Range r1 =null ;

Microsoft.Office.Interop.Excel.Workbook newbook = e1.Workbooks.Add(Missing .Value );
Microsoft.Office.Interop.Excel.Worksheet newsheet = (Microsoft .Office .Interop .Excel .Worksheet )newbook.Worksheets.Add(Missing .Value , Missing.Value,12, Missing.Value);

Microsoft.Office.Intero

错误 1 命名空间“Microsoft”中不存在类型或命名空间名称“Office”(是缺少程序集引用吗?) d:\bob\Documents\Visual Studio 2005\Projects\Project1\Project1\Program.cs 6 17 exel

仔细看看是不是参数数量多了一个或少了一个?类型对应是否正确?