:
Microsoft.Office.Interop.Excel.Application app = null;
Microsoft.Office.Interop.Excel.Workbooks books = null;
Workbook book = null;
Sheets sheets = null;
Worksheet sheet = null;
Range range = null;
try
{
app = new Microsoft.Office.Interop.Excel.Application();
books = app.Workbooks;
book = books.Add();
sheets = book.Sheets;
sheet = sheets.Add();
range = sheet.Range["A1"];
range.Value = "Lorem Ipsum";
book.SaveAs(@"C:\Temp\ExcelBook" + DateTime.Now.Millisecond + ".xlsx");
book.Close();
app.Quit();
}
finally
{
if (range != null) Marshal.ReleaseComObject(range);
if (sheet != null) Marshal.ReleaseComObject(sheet);
if (sheets != null) Marshal.ReleaseComObject(sheets);
if (book != null) Marshal.ReleaseComObject(book);
if (books != null) Marshal.ReleaseComObject(books);
if (app != null) Marshal.ReleaseComObject(app);
}
在此之后,我试图将项目作为gradle项目导入eclipse,我已经在Eclipse中安装了buildship插件。但是虽然导入它会给出疯狂的错误,所以有没有任何版本/模型的eclipse与gradle最兼容
我尝试使用eclipse JUNO + JDK 1.7 + gradle 1.9
我收到错误:
gralde clean build eclipse --refresh-dependencies