初学C#,关于Excel求解
Excel 表"A1"里是时间格式 2013-06-25用的是老的2003
导入Excel 11.0 COM组件
using System;
using System.Reflection;
using Excel;
static void Main()
{
Excel.Application Ex = new Excel.Application();
Ex.Visible = false;
Excel.Workbook ExBook = Ex.Workbooks._Open(@"123.xls",Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value);
Excel.Worksheet ExSheet = (Excel.Worksheet)ExBook.Sheets[1];
Excel.Range a = ExSheet.get_Range("A1",Type.Missing);
Console.WriteLine(a);
ExSheet = null; ExBook = null; Ex.Quit(); Ex = null;
}//最后a 只输出2013 这是为什么?