DotNet创建一个新的Excel文件
Imports XExcel = Microsoft.Office.Interop.Excel
Dim pExcelApp As New Microsoft.Office.Interop.Excel.Application
Dim pExcelWorkBook As XExcel.Workbook = pExcelApp.Workbooks.Add(XExcel.XlWBATemplate.xlWBATWorksheet)
MyPath = “T:\ExcelTest”
pResultPath = “T:\ExcelTest\Result”
Dim pSheet As XExcel.Worksheet = pExcelWorkBook.Sheets.Add()
pSheet.Range(“A3”).Value = “hello world”
pExcelWorkBook.SaveAs(pResultPath & “\” & “Result.xls”)
pExcelWorkBook.Close()
pExcelApp.Workbooks.Close()
pExcelApp.Quit()